/* Generated by Cython 0.24 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_24"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
  #define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__netif
#define __PYX_HAVE_API__netif
#include "stdint.h"
#include "sys/types.h"
#include "net/if.h"
#include "sys/sysctl.h"
#include "ifaddrs.h"
#include "sys/socket.h"
#include "netinet/in.h"
#include "net/if_dl.h"
#include "net/if_var.h"
#include "netinet6/in6_var.h"
#include "netinet6/nd6.h"
#include "net/if_media.h"
#include "net/route.h"
#include "sys/ioctl.h"
#include "net/ethernet.h"
#include "sys/sockio.h"
#include "net/if_lagg.h"
#include "net/if_bridgevar.h"
#include "net/if_vlan_var.h"
#include "netinet/ip_carp.h"
#include "net/if_types.h"
#include "unistd.h"
#include "errno.h"
#include "string.h"
#include "stdlib.h"
#include "ifmedia.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "netif.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_5netif_NetworkInterface;
struct __pyx_obj_5netif_LaggInterface;
struct __pyx_obj_5netif_BridgeInterface;
struct __pyx_obj_5netif_VlanInterface;
struct __pyx_obj_5netif_RoutingPacket;
struct __pyx_obj_5netif_InterfaceAnnounceMessage;
struct __pyx_obj_5netif_InterfaceInfoMessage;
struct __pyx_obj_5netif_InterfaceAddrMessage;
struct __pyx_obj_5netif_RoutingMessage;
struct __pyx_obj_5netif___pyx_scope_struct____get__;
struct __pyx_obj_5netif___pyx_scope_struct_1___get__;
struct __pyx_obj_5netif___pyx_scope_struct_2___get__;
struct __pyx_obj_5netif___pyx_scope_struct_3_routes;
struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr;
struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr;
struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr;
struct __pyx_opt_args_5netif_16NetworkInterface_ioctl;
struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags;

/* "netif.pyx":583
 *         return True
 * 
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:
 */
struct __pyx_opt_args_5netif_16NetworkInterface_ioctl {
  int __pyx_n;
  PyObject *af;
};

/* "netif.pyx":682
 *         return ifr.ifr_ifru.ifru_flags[0]
 * 
 *     cdef uint32_t __rw_nd6_flags(self, value=None) except? -1:             # <<<<<<<<<<<<<<
 *         cdef defs.in6_ndireq nd;
 *         memset(&nd, 0, cython.sizeof(nd))
 */
struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags {
  int __pyx_n;
  PyObject *value;
};

/* "netif.pyx":558
 *     sock3 = socket.socket
 * 
 * cdef class NetworkInterface(object):             # <<<<<<<<<<<<<<
 *     cdef readonly object name
 *     cdef object nameb
 */
struct __pyx_obj_5netif_NetworkInterface {
  PyObject_HEAD
  struct __pyx_vtabstruct_5netif_NetworkInterface *__pyx_vtab;
  PyObject *name;
  PyObject *nameb;
  PyObject *type;
  PyObject *addresses;
};


/* "netif.pyx":1015
 * 
 * 
 * cdef class LaggInterface(NetworkInterface):             # <<<<<<<<<<<<<<
 *     def __getstate__(self):
 *         state = super(LaggInterface, self).__getstate__()
 */
struct __pyx_obj_5netif_LaggInterface {
  struct __pyx_obj_5netif_NetworkInterface __pyx_base;
};


/* "netif.pyx":1076
 * 
 * 
 * cdef class BridgeInterface(NetworkInterface):             # <<<<<<<<<<<<<<
 *     def __getstate__(self):
 *         state = super(BridgeInterface, self).__getstate__()
 */
struct __pyx_obj_5netif_BridgeInterface {
  struct __pyx_obj_5netif_NetworkInterface __pyx_base;
};


/* "netif.pyx":1133
 * 
 * 
 * cdef class VlanInterface(NetworkInterface):             # <<<<<<<<<<<<<<
 *     def __getstate__(self):
 *         state = super(VlanInterface, self).__getstate__()
 */
struct __pyx_obj_5netif_VlanInterface {
  struct __pyx_obj_5netif_NetworkInterface __pyx_base;
};


/* "netif.pyx":1191
 * 
 * 
 * cdef class RoutingPacket(object):             # <<<<<<<<<<<<<<
 *     cdef readonly object data
 *     cdef char *buffer
 */
struct __pyx_obj_5netif_RoutingPacket {
  PyObject_HEAD
  struct __pyx_vtabstruct_5netif_RoutingPacket *__pyx_vtab;
  PyObject *data;
  char *buffer;
  size_t bufsize;
  struct rt_msghdr *rt_msg;
};


/* "netif.pyx":1349
 * 
 * 
 * cdef class InterfaceAnnounceMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef defs.if_announcemsghdr* header
 * 
 */
struct __pyx_obj_5netif_InterfaceAnnounceMessage {
  struct __pyx_obj_5netif_RoutingPacket __pyx_base;
  struct if_announcemsghdr *header;
};


/* "netif.pyx":1374
 * 
 * 
 * cdef class InterfaceInfoMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef defs.if_msghdr* header
 *     cdef readonly object addrs
 */
struct __pyx_obj_5netif_InterfaceInfoMessage {
  struct __pyx_obj_5netif_RoutingPacket __pyx_base;
  struct if_msghdr *header;
  PyObject *addrs;
  int addrs_mask;
};


/* "netif.pyx":1415
 *             return None
 * 
 * cdef class InterfaceAddrMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef defs.ifa_msghdr* header
 *     cdef readonly object addrs
 */
struct __pyx_obj_5netif_InterfaceAddrMessage {
  struct __pyx_obj_5netif_RoutingPacket __pyx_base;
  struct ifa_msghdr *header;
  PyObject *addrs;
  int addrs_mask;
};


/* "netif.pyx":1478
 * 
 * 
 * cdef class RoutingMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef readonly object addrs
 *     cdef int addrs_mask
 */
struct __pyx_obj_5netif_RoutingMessage {
  struct __pyx_obj_5netif_RoutingPacket __pyx_base;
  PyObject *addrs;
  int addrs_mask;
  int free;
};


/* "netif.pyx":904
 * 
 *     property carp_config:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.carpreq carpr[defs.CARP_MAXVHID]
 */
struct __pyx_obj_5netif___pyx_scope_struct____get__ {
  PyObject_HEAD
  PyObject *__pyx_v_addr;
  struct carpreq __pyx_v_carpr[CARP_MAXVHID];
  int __pyx_v_i;
  struct ifreq __pyx_v_ifr;
  struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self;
  PyObject *__pyx_v_vhid_map;
  int __pyx_t_0;
  int __pyx_t_1;
};


/* "netif.pyx":1060
 * 
 *     property ports:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             cdef defs.lagg_reqport lport[16]
 */
struct __pyx_obj_5netif___pyx_scope_struct_1___get__ {
  PyObject_HEAD
  long __pyx_v_i;
  struct lagg_reqport __pyx_v_lport[16];
  struct lagg_reqall __pyx_v_lreq;
  struct __pyx_obj_5netif_LaggInterface *__pyx_v_self;
  int __pyx_t_0;
  long __pyx_t_1;
};


/* "netif.pyx":1110
 * 
 *     property members:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifbreq* ifbr = NULL
 *             cdef defs.ifbifconf ifbc
 */
struct __pyx_obj_5netif___pyx_scope_struct_2___get__ {
  PyObject_HEAD
  char *__pyx_v_buf;
  size_t __pyx_v_i;
  struct ifbifconf __pyx_v_ifbc;
  struct ifbreq *__pyx_v_ifbr;
  struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self;
  int __pyx_v_size;
  size_t __pyx_t_0;
  size_t __pyx_t_1;
};


/* "netif.pyx":1688
 * 
 *     @property
 *     def routes(self):             # <<<<<<<<<<<<<<
 *         cdef char* buf
 *         cdef defs.rt_msghdr* rt_msg
 */
struct __pyx_obj_5netif___pyx_scope_struct_3_routes {
  PyObject_HEAD
  char *__pyx_v_buf;
  PyObject *__pyx_v_data;
  struct __pyx_obj_5netif_RoutingMessage *__pyx_v_msg;
  PyObject *__pyx_v_ptr;
  struct rt_msghdr *__pyx_v_rt_msg;
  PyObject *__pyx_v_self;
};


/* "netif.pyx":1821
 *         # the last one here overrides due to the update().
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 */
struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_i;
};


/* "netif.pyx":1822
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))
 */
struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_i;
};


/* "netif.pyx":1823
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)             # <<<<<<<<<<<<<<
 *                             for i in get_ifgroup('bridge')))
 * 
 */
struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_i;
};



/* "netif.pyx":558
 *     sock3 = socket.socket
 * 
 * cdef class NetworkInterface(object):             # <<<<<<<<<<<<<<
 *     cdef readonly object name
 *     cdef object nameb
 */

struct __pyx_vtabstruct_5netif_NetworkInterface {
  int (*query_media)(struct __pyx_obj_5netif_NetworkInterface *, struct ifmediareq *);
  int (*ioctl)(struct __pyx_obj_5netif_NetworkInterface *, uint32_t, void *, struct __pyx_opt_args_5netif_16NetworkInterface_ioctl *__pyx_optional_args);
  PyObject *(*aliasreq)(struct __pyx_obj_5netif_NetworkInterface *, PyObject *, uint32_t);
  uint32_t (*__pyx___get_flags)(struct __pyx_obj_5netif_NetworkInterface *);
  uint32_t (*__pyx___rw_nd6_flags)(struct __pyx_obj_5netif_NetworkInterface *, struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5netif_NetworkInterface *__pyx_vtabptr_5netif_NetworkInterface;


/* "netif.pyx":1015
 * 
 * 
 * cdef class LaggInterface(NetworkInterface):             # <<<<<<<<<<<<<<
 *     def __getstate__(self):
 *         state = super(LaggInterface, self).__getstate__()
 */

struct __pyx_vtabstruct_5netif_LaggInterface {
  struct __pyx_vtabstruct_5netif_NetworkInterface __pyx_base;
};
static struct __pyx_vtabstruct_5netif_LaggInterface *__pyx_vtabptr_5netif_LaggInterface;


/* "netif.pyx":1076
 * 
 * 
 * cdef class BridgeInterface(NetworkInterface):             # <<<<<<<<<<<<<<
 *     def __getstate__(self):
 *         state = super(BridgeInterface, self).__getstate__()
 */

struct __pyx_vtabstruct_5netif_BridgeInterface {
  struct __pyx_vtabstruct_5netif_NetworkInterface __pyx_base;
  PyObject *(*bridge_cmd)(struct __pyx_obj_5netif_BridgeInterface *, PyObject *, void *, size_t, int);
};
static struct __pyx_vtabstruct_5netif_BridgeInterface *__pyx_vtabptr_5netif_BridgeInterface;


/* "netif.pyx":1133
 * 
 * 
 * cdef class VlanInterface(NetworkInterface):             # <<<<<<<<<<<<<<
 *     def __getstate__(self):
 *         state = super(VlanInterface, self).__getstate__()
 */

struct __pyx_vtabstruct_5netif_VlanInterface {
  struct __pyx_vtabstruct_5netif_NetworkInterface __pyx_base;
  PyObject *(*get_vlan)(struct __pyx_obj_5netif_VlanInterface *);
};
static struct __pyx_vtabstruct_5netif_VlanInterface *__pyx_vtabptr_5netif_VlanInterface;


/* "netif.pyx":1191
 * 
 * 
 * cdef class RoutingPacket(object):             # <<<<<<<<<<<<<<
 *     cdef readonly object data
 *     cdef char *buffer
 */

struct __pyx_vtabstruct_5netif_RoutingPacket {
  PyObject *(*_grow)(struct __pyx_obj_5netif_RoutingPacket *, PyObject *);
  PyObject *(*_align_sa_len)(struct __pyx_obj_5netif_RoutingPacket *, int);
  PyObject *(*_parse_sockaddr_dl)(struct __pyx_obj_5netif_RoutingPacket *, struct sockaddr_dl *);
  PyObject *(*_parse_sockaddrs)(struct __pyx_obj_5netif_RoutingPacket *, int, int);
  PyObject *(*_pack_sockaddrs)(struct __pyx_obj_5netif_RoutingPacket *, int, PyObject *);
};
static struct __pyx_vtabstruct_5netif_RoutingPacket *__pyx_vtabptr_5netif_RoutingPacket;


/* "netif.pyx":1349
 * 
 * 
 * cdef class InterfaceAnnounceMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef defs.if_announcemsghdr* header
 * 
 */

struct __pyx_vtabstruct_5netif_InterfaceAnnounceMessage {
  struct __pyx_vtabstruct_5netif_RoutingPacket __pyx_base;
};
static struct __pyx_vtabstruct_5netif_InterfaceAnnounceMessage *__pyx_vtabptr_5netif_InterfaceAnnounceMessage;


/* "netif.pyx":1374
 * 
 * 
 * cdef class InterfaceInfoMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef defs.if_msghdr* header
 *     cdef readonly object addrs
 */

struct __pyx_vtabstruct_5netif_InterfaceInfoMessage {
  struct __pyx_vtabstruct_5netif_RoutingPacket __pyx_base;
};
static struct __pyx_vtabstruct_5netif_InterfaceInfoMessage *__pyx_vtabptr_5netif_InterfaceInfoMessage;


/* "netif.pyx":1415
 *             return None
 * 
 * cdef class InterfaceAddrMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef defs.ifa_msghdr* header
 *     cdef readonly object addrs
 */

struct __pyx_vtabstruct_5netif_InterfaceAddrMessage {
  struct __pyx_vtabstruct_5netif_RoutingPacket __pyx_base;
};
static struct __pyx_vtabstruct_5netif_InterfaceAddrMessage *__pyx_vtabptr_5netif_InterfaceAddrMessage;


/* "netif.pyx":1478
 * 
 * 
 * cdef class RoutingMessage(RoutingPacket):             # <<<<<<<<<<<<<<
 *     cdef readonly object addrs
 *     cdef int addrs_mask
 */

struct __pyx_vtabstruct_5netif_RoutingMessage {
  struct __pyx_vtabstruct_5netif_RoutingPacket __pyx_base;
};
static struct __pyx_vtabstruct_5netif_RoutingMessage *__pyx_vtabptr_5netif_RoutingMessage;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* PyObjectSetAttrStr.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* PyObjectLookupSpecial.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* SaveResetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* ListCompAppend.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* pop.proto */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L);
#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\
    __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L))
#else
#define __Pyx_PyList_Pop(L)  __Pyx__PyObject_Pop(L)
#define __Pyx_PyObject_Pop(L)  __Pyx__PyObject_Pop(L)
#endif

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    ((likely((cfunc)->func)) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
             ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* IncludeStringH.proto */
#include <string.h>

/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

/* ListAppend.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* SwapException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_u_short(u_short value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_sa_family_t(sa_family_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_u_char(u_char value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE u_short __Pyx_PyInt_As_u_short(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE u_char __Pyx_PyInt_As_u_char(PyObject *);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject *type, __pyx_coroutine_body_t body,
                                                   PyObject *closure, PyObject *name, PyObject *qualname);
static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, closure, name, qualname)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static int __pyx_f_5netif_16NetworkInterface_query_media(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, struct ifmediareq *__pyx_v_ifm); /* proto*/
static int __pyx_f_5netif_16NetworkInterface_ioctl(CYTHON_UNUSED struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, uint32_t __pyx_v_cmd, void *__pyx_v_args, struct __pyx_opt_args_5netif_16NetworkInterface_ioctl *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5netif_16NetworkInterface_aliasreq(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_address, uint32_t __pyx_v_cmd); /* proto*/
static uint32_t __pyx_f_5netif_16NetworkInterface___get_flags(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto*/
static uint32_t __pyx_f_5netif_16NetworkInterface___rw_nd6_flags(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_5netif_15BridgeInterface_bridge_cmd(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self, PyObject *__pyx_v_cmd, void *__pyx_v_arg, size_t __pyx_v_size, int __pyx_v_set); /* proto*/
static PyObject *__pyx_f_5netif_13VlanInterface_get_vlan(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_5netif_13RoutingPacket__grow(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, PyObject *__pyx_v_amount); /* proto*/
static PyObject *__pyx_f_5netif_13RoutingPacket__align_sa_len(CYTHON_UNUSED struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, int __pyx_v_length); /* proto*/
static PyObject *__pyx_f_5netif_13RoutingPacket__parse_sockaddr_dl(CYTHON_UNUSED struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, struct sockaddr_dl *__pyx_v_sdl); /* proto*/
static PyObject *__pyx_f_5netif_13RoutingPacket__parse_sockaddrs(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, int __pyx_v_start_offset, int __pyx_v_mask); /* proto*/
static PyObject *__pyx_f_5netif_13RoutingPacket__pack_sockaddrs(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, int __pyx_v_start_offset, PyObject *__pyx_v_addrs); /* proto*/

/* Module declarations from 'cython' */

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'posix.types' */

/* Module declarations from 'defs' */

/* Module declarations from 'libc.errno' */

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'netif' */
static PyTypeObject *__pyx_ptype_5netif_NetworkInterface = 0;
static PyTypeObject *__pyx_ptype_5netif_LaggInterface = 0;
static PyTypeObject *__pyx_ptype_5netif_BridgeInterface = 0;
static PyTypeObject *__pyx_ptype_5netif_VlanInterface = 0;
static PyTypeObject *__pyx_ptype_5netif_RoutingPacket = 0;
static PyTypeObject *__pyx_ptype_5netif_InterfaceAnnounceMessage = 0;
static PyTypeObject *__pyx_ptype_5netif_InterfaceInfoMessage = 0;
static PyTypeObject *__pyx_ptype_5netif_InterfaceAddrMessage = 0;
static PyTypeObject *__pyx_ptype_5netif_RoutingMessage = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct____get__ = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct_1___get__ = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct_2___get__ = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct_3_routes = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct_4_genexpr = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_5netif___pyx_scope_struct_6_genexpr = 0;
static int __pyx_f_5netif__get_in6_ifa_flags(char *, struct sockaddr_in6 *); /*proto*/
static PyObject *__pyx_f_5netif_list_interfaces_internal(PyObject *, PyObject *, struct ifaddrs *); /*proto*/
#define __Pyx_MODULE_NAME "netif"
int __pyx_module_is_main_netif = 0;

/* Implementation of 'netif' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_bin;
static PyObject *__pyx_builtin_OSError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_filter;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static const char __pyx_k_1[] = "1";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_HY[] = "HY";
static const char __pyx_k_IP[] = "IP";
static const char __pyx_k_T1[] = "T1";
static const char __pyx_k_UP[] = "UP";
static const char __pyx_k_af[] = "af";
static const char __pyx_k_eq[] = "__eq__";
static const char __pyx_k_ip[] = "ip";
static const char __pyx_k_lo[] = "lo";
static const char __pyx_k_ne[] = "__ne__";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_0_1[] = "{0}/{1}";
static const char __pyx_k_ADD[] = "ADD";
static const char __pyx_k_ARP[] = "ARP";
static const char __pyx_k_ATM[] = "ATM";
static const char __pyx_k_BSC[] = "BSC";
static const char __pyx_k_CES[] = "CES";
static const char __pyx_k_CNR[] = "CNR";
static const char __pyx_k_CNT[] = "CNT";
static const char __pyx_k_DCN[] = "DCN";
static const char __pyx_k_DLI[] = "DLI";
static const char __pyx_k_DS0[] = "DS0";
static const char __pyx_k_DS3[] = "DS3";
static const char __pyx_k_DTM[] = "DTM";
static const char __pyx_k_ENC[] = "ENC";
static const char __pyx_k_EON[] = "EON";
static const char __pyx_k_FDX[] = "FDX";
static const char __pyx_k_GET[] = "GET";
static const char __pyx_k_GIF[] = "GIF";
static const char __pyx_k_HDX[] = "HDX";
static const char __pyx_k_IMT[] = "IMT";
static const char __pyx_k_IPX[] = "IPX";
static const char __pyx_k_ISO[] = "ISO";
static const char __pyx_k_LAT[] = "LAT";
static const char __pyx_k_LRO[] = "LRO";
static const char __pyx_k_MPC[] = "MPC";
static const char __pyx_k_MVL[] = "MVL";
static const char __pyx_k_OSI[] = "OSI";
static const char __pyx_k_P10[] = "P10";
static const char __pyx_k_P80[] = "P80";
static const char __pyx_k_PLC[] = "PLC";
static const char __pyx_k_POS[] = "POS";
static const char __pyx_k_PPP[] = "PPP";
static const char __pyx_k_PUP[] = "PUP";
static const char __pyx_k_PVC[] = "PVC";
static const char __pyx_k_SIP[] = "SIP";
static const char __pyx_k_SNA[] = "SNA";
static const char __pyx_k_SRP[] = "SRP";
static const char __pyx_k_STF[] = "STF";
static const char __pyx_k_USB[] = "USB";
static const char __pyx_k_V11[] = "V11";
static const char __pyx_k_V35[] = "V35";
static const char __pyx_k_V36[] = "V36";
static const char __pyx_k_V37[] = "V37";
static const char __pyx_k_X25[] = "X25";
static const char __pyx_k__15[] = ":";
static const char __pyx_k__18[] = "::";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_bin[] = "bin";
static const char __pyx_k_bsd[] = "bsd";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "__get__";
static const char __pyx_k_ifa[] = "ifa";
static const char __pyx_k_ifg[] = "ifg";
static const char __pyx_k_ifr[] = "ifr";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_len[] = "len";
static const char __pyx_k_mem[] = "mem";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_mtu[] = "mtu";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_ptr[] = "ptr";
static const char __pyx_k_ret[] = "ret";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_tag[] = "tag";
static const char __pyx_k_tap[] = "tap";
static const char __pyx_k_tun[] = "tun";
static const char __pyx_k_AAL2[] = "AAL2";
static const char __pyx_k_AAL5[] = "AAL5";
static const char __pyx_k_ADSL[] = "ADSL";
static const char __pyx_k_ARAP[] = "ARAP";
static const char __pyx_k_AUTO[] = "AUTO";
static const char __pyx_k_CEPT[] = "CEPT";
static const char __pyx_k_COIP[] = "COIP";
static const char __pyx_k_DLSW[] = "DLSW";
static const char __pyx_k_DONE[] = "DONE";
static const char __pyx_k_E164[] = "E164";
static const char __pyx_k_ECMA[] = "ECMA";
static const char __pyx_k_FAST[] = "FAST";
static const char __pyx_k_FDDI[] = "FDDI";
static const char __pyx_k_FLOW[] = "FLOW";
static const char __pyx_k_HDLC[] = "HDLC";
static const char __pyx_k_HOST[] = "HOST";
static const char __pyx_k_HSSI[] = "HSSI";
static const char __pyx_k_IDSL[] = "IDSL";
static const char __pyx_k_INET[] = "INET";
static const char __pyx_k_INIT[] = "INIT";
static const char __pyx_k_ISDN[] = "ISDN";
static const char __pyx_k_ISUP[] = "ISUP";
static const char __pyx_k_LACP[] = "LACP";
static const char __pyx_k_LAPB[] = "LAPB";
static const char __pyx_k_LAPD[] = "LAPD";
static const char __pyx_k_LAPF[] = "LAPF";
static const char __pyx_k_LINK[] = "LINK";
static const char __pyx_k_LOCK[] = "LOCK";
static const char __pyx_k_LOOP[] = "LOOP";
static const char __pyx_k_MISS[] = "MISS";
static const char __pyx_k_MPLS[] = "MPLS";
static const char __pyx_k_NATM[] = "NATM";
static const char __pyx_k_NFAS[] = "NFAS";
static const char __pyx_k_NONE[] = "NONE";
static const char __pyx_k_NSIP[] = "NSIP";
static const char __pyx_k_PARA[] = "PARA";
static const char __pyx_k_QLLC[] = "QLLC";
static const char __pyx_k_RSRB[] = "RSRB";
static const char __pyx_k_SDLC[] = "SDLC";
static const char __pyx_k_SDSL[] = "SDSL";
static const char __pyx_k_SLIP[] = "SLIP";
static const char __pyx_k_SLOW[] = "SLOW";
static const char __pyx_k_TDLC[] = "TDLC";
static const char __pyx_k_TOE4[] = "TOE4";
static const char __pyx_k_TOE6[] = "TOE6";
static const char __pyx_k_TSO4[] = "TSO4";
static const char __pyx_k_TSO6[] = "TSO6";
static const char __pyx_k_UNIX[] = "UNIX";
static const char __pyx_k_VDSL[] = "VDSL";
static const char __pyx_k_X213[] = "X213";
static const char __pyx_k_addr[] = "addr";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_carp[] = "carp";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_fe80[] = "fe80:";
static const char __pyx_k_hash[] = "__hash__";
static const char __pyx_k_ifgr[] = "ifgr";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_lagg[] = "lagg";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sock[] = "sock";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_vhid[] = "vhid";
static const char __pyx_k_vlan[] = "vlan";
static const char __pyx_k_0_02x[] = "{0:02x}";
static const char __pyx_k_ASYNC[] = "ASYNC";
static const char __pyx_k_CCITT[] = "CCITT";
static const char __pyx_k_CHAOS[] = "CHAOS";
static const char __pyx_k_DEBUG[] = "DEBUG";
static const char __pyx_k_DYING[] = "DYING";
static const char __pyx_k_EPLRS[] = "EPLRS";
static const char __pyx_k_ESCON[] = "ESCON";
static const char __pyx_k_ETHER[] = "ETHER";
static const char __pyx_k_FLAG0[] = "FLAG0";
static const char __pyx_k_FLAG1[] = "FLAG1";
static const char __pyx_k_FLAG2[] = "FLAG2";
static const char __pyx_k_HDSL2[] = "HDSL2";
static const char __pyx_k_HIPPI[] = "HIPPI";
static const char __pyx_k_I1822[] = "I1822";
static const char __pyx_k_IFGSN[] = "IFGSN";
static const char __pyx_k_INET6[] = "INET6";
static const char __pyx_k_ISDNS[] = "ISDNS";
static const char __pyx_k_ISDNU[] = "ISDNU";
static const char __pyx_k_LINK0[] = "LINK0";
static const char __pyx_k_LINK1[] = "LINK1";
static const char __pyx_k_LINK2[] = "LINK2";
static const char __pyx_k_LOCAL[] = "LOCAL";
static const char __pyx_k_MODEM[] = "MODEM";
static const char __pyx_k_MSDSL[] = "MSDSL";
static const char __pyx_k_NOARP[] = "NOARP";
static const char __pyx_k_OTHER[] = "OTHER";
static const char __pyx_k_PFLOG[] = "PFLOG";
static const char __pyx_k_RADSL[] = "RADSL";
static const char __pyx_k_ROUTE[] = "ROUTE";
static const char __pyx_k_RS232[] = "RS232";
static const char __pyx_k_Route[] = "Route";
static const char __pyx_k_SHDSL[] = "SHDSL";
static const char __pyx_k_SLAVE[] = "SLAVE";
static const char __pyx_k_SONET[] = "SONET";
static const char __pyx_k_STACK[] = "STACK";
static const char __pyx_k_TR008[] = "TR008";
static const char __pyx_k_ULTRA[] = "ULTRA";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_epair[] = "epair";
static const char __pyx_k_errno[] = "errno";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_get_2[] = "get";
static const char __pyx_k_htonl[] = "htonl";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_itype[] = "itype";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_netif[] = "netif";
static const char __pyx_k_ntohl[] = "ntohl";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_ports[] = "ports";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_route[] = "route";
static const char __pyx_k_scope[] = "scope";
static const char __pyx_k_sock3[] = "sock3";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_ACTIVE[] = "ACTIVE";
static const char __pyx_k_ARCNET[] = "ARCNET";
static const char __pyx_k_ATMDXI[] = "ATMDXI";
static const char __pyx_k_ATMIMA[] = "ATMIMA";
static const char __pyx_k_BACKUP[] = "BACKUP";
static const char __pyx_k_BRIDGE[] = "BRIDGE";
static const char __pyx_k_CHANGE[] = "CHANGE";
static const char __pyx_k_COFFEE[] = "COFFEE";
static const char __pyx_k_DECnet[] = "DECnet";
static const char __pyx_k_DELETE[] = "DELETE";
static const char __pyx_k_DS1FDL[] = "DS1FDL";
static const char __pyx_k_FRELAY[] = "FRELAY";
static const char __pyx_k_HYLINK[] = "HYLINK";
static const char __pyx_k_IFINFO[] = "IFINFO";
static const char __pyx_k_L2VLAN[] = "L2VLAN";
static const char __pyx_k_LLDATA[] = "LLDATA";
static const char __pyx_k_LLINFO[] = "LLINFO";
static const char __pyx_k_LOSING[] = "LOSING";
static const char __pyx_k_MANUAL[] = "MANUAL";
static const char __pyx_k_MASTER[] = "MASTER";
static const char __pyx_k_MIOX25[] = "MIOX25";
static const char __pyx_k_NETMAP[] = "NETMAP";
static const char __pyx_k_PFSYNC[] = "PFSYNC";
static const char __pyx_k_PINNED[] = "PINNED";
static const char __pyx_k_PROTO1[] = "PROTO1";
static const char __pyx_k_PROTO2[] = "PROTO2";
static const char __pyx_k_PROTO3[] = "PROTO3";
static const char __pyx_k_REJECT[] = "REJECT";
static const char __pyx_k_RXCSUM[] = "RXCSUM";
static const char __pyx_k_STATIC[] = "STATIC";
static const char __pyx_k_STICKY[] = "STICKY";
static const char __pyx_k_TUNNEL[] = "TUNNEL";
static const char __pyx_k_TXCSUM[] = "TXCSUM";
static const char __pyx_k_X25DDN[] = "X25DDN";
static const char __pyx_k_X25MLP[] = "X25MLP";
static const char __pyx_k_X25PLE[] = "X25PLE";
static const char __pyx_k_XETHER[] = "XETHER";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_bridge[] = "bridge";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_change[] = "change";
static const char __pyx_k_cloned[] = "cloned";
static const char __pyx_k_delete[] = "delete";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_fileno[] = "fileno";
static const char __pyx_k_filter[] = "filter";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_ifname[] = "ifname";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_packed[] = "packed";
static const char __pyx_k_packet[] = "packet";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_routes[] = "routes";
static const char __pyx_k_rt_msg[] = "rt_msg";
static const char __pyx_k_socket[] = "socket";
static const char __pyx_k_sysctl[] = "sysctl";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_xrange[] = "xrange";
static const char __pyx_k_0_0_0_0[] = "0.0.0.0";
static const char __pyx_k_AF_INET[] = "AF_INET";
static const char __pyx_k_AF_UNIX[] = "AF_UNIX";
static const char __pyx_k_ANYCAST[] = "ANYCAST";
static const char __pyx_k_ARRIVAL[] = "ARRIVAL";
static const char __pyx_k_ATMFUNI[] = "ATMFUNI";
static const char __pyx_k_CCTEMUL[] = "CCTEMUL";
static const char __pyx_k_CHANNEL[] = "CHANNEL";
static const char __pyx_k_DATAKIT[] = "DATAKIT";
static const char __pyx_k_DELADDR[] = "DELADDR";
static const char __pyx_k_DYNAMIC[] = "DYNAMIC";
static const char __pyx_k_GATEWAY[] = "GATEWAY";
static const char __pyx_k_HDH1822[] = "HDH1822";
static const char __pyx_k_HOSTPAD[] = "HOSTPAD";
static const char __pyx_k_HWSTATS[] = "HWSTATS";
static const char __pyx_k_IMPLINK[] = "IMPLINK";
static const char __pyx_k_INVALID[] = "INVALID";
static const char __pyx_k_IntEnum[] = "IntEnum";
static const char __pyx_k_MONITOR[] = "MONITOR";
static const char __pyx_k_MYRINET[] = "MYRINET";
static const char __pyx_k_NETBIOS[] = "NETBIOS";
static const char __pyx_k_NETCONS[] = "NETCONS";
static const char __pyx_k_NEWADDR[] = "NEWADDR";
static const char __pyx_k_NO_RADR[] = "NO_RADR";
static const char __pyx_k_OSError[] = "OSError";
static const char __pyx_k_POLLING[] = "POLLING";
static const char __pyx_k_PROMISC[] = "PROMISC";
static const char __pyx_k_PROPMUX[] = "PROPMUX";
static const char __pyx_k_RESOLVE[] = "RESOLVE";
static const char __pyx_k_RFC1483[] = "RFC1483";
static const char __pyx_k_SIMPLEX[] = "SIMPLEX";
static const char __pyx_k_SMDSDXI[] = "SMDSDXI";
static const char __pyx_k_SONETVT[] = "SONETVT";
static const char __pyx_k_STARLAN[] = "STARLAN";
static const char __pyx_k_TERMPAD[] = "TERMPAD";
static const char __pyx_k_VOICEEM[] = "VOICEEM";
static const char __pyx_k_address[] = "address";
static const char __pyx_k_advbase[] = "advbase";
static const char __pyx_k_advskew[] = "advskew";
static const char __pyx_k_aliases[] = "aliases";
static const char __pyx_k_exc_val[] = "exc_val";
static const char __pyx_k_gateway[] = "gateway";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_members[] = "members";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_netmask[] = "netmask";
static const char __pyx_k_network[] = "network";
static const char __pyx_k_popitem[] = "popitem";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_typemap[] = "typemap";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_AF_INET6[] = "AF_INET6";
static const char __pyx_k_AF_ROUTE[] = "AF_ROUTE";
static const char __pyx_k_ALLMULTI[] = "ALLMULTI";
static const char __pyx_k_ATMRADIO[] = "ATMRADIO";
static const char __pyx_k_AUTOCONF[] = "AUTOCONF";
static const char __pyx_k_DELMADDR[] = "DELMADDR";
static const char __pyx_k_DETACHED[] = "DETACHED";
static const char __pyx_k_DISABLED[] = "DISABLED";
static const char __pyx_k_DVBASILN[] = "DVBASILN";
static const char __pyx_k_FAILOVER[] = "FAILOVER";
static const char __pyx_k_GR303IDT[] = "GR303IDT";
static const char __pyx_k_GR303RDT[] = "GR303RDT";
static const char __pyx_k_IEEE1394[] = "IEEE1394";
static const char __pyx_k_INET_SDP[] = "INET_SDP";
static const char __pyx_k_IPSWITCH[] = "IPSWITCH";
static const char __pyx_k_ISO88023[] = "ISO88023";
static const char __pyx_k_ISO88024[] = "ISO88024";
static const char __pyx_k_ISO88025[] = "ISO88025";
static const char __pyx_k_ISO88026[] = "ISO88026";
static const char __pyx_k_L3IPVLAN[] = "L3IPVLAN";
static const char __pyx_k_LOOPBACK[] = "LOOPBACK";
static const char __pyx_k_MODIFIED[] = "MODIFIED";
static const char __pyx_k_NETGRAPH[] = "NETGRAPH";
static const char __pyx_k_NEWMADDR[] = "NEWMADDR";
static const char __pyx_k_PPROMISC[] = "PPROMISC";
static const char __pyx_k_PROPCNLS[] = "PROPCNLS";
static const char __pyx_k_RADIOMAC[] = "RADIOMAC";
static const char __pyx_k_REACHDSL[] = "REACHDSL";
static const char __pyx_k_REDIRECT[] = "REDIRECT";
static const char __pyx_k_RENAMING[] = "RENAMING";
static const char __pyx_k_Route_af[] = "Route.af";
static const char __pyx_k_SCLUSTER[] = "SCLUSTER";
static const char __pyx_k_SMDSICIP[] = "SMDSICIP";
static const char __pyx_k_SOCK_RAW[] = "SOCK_RAW";
static const char __pyx_k_VLAN_MTU[] = "VLAN_MTU";
static const char __pyx_k_VOICEFXO[] = "VOICEFXO";
static const char __pyx_k_VOICEFXS[] = "VOICEFXS";
static const char __pyx_k_XRESOLVE[] = "XRESOLVE";
static const char __pyx_k_exc_type[] = "exc_type";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_protocol[] = "protocol";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_strerror[] = "strerror";
static const char __pyx_k_tostring[] = "tostring";
static const char __pyx_k_APPLETALK[] = "APPLETALK";
static const char __pyx_k_BLACKHOLE[] = "BLACKHOLE";
static const char __pyx_k_BLUETOOTH[] = "BLUETOOTH";
static const char __pyx_k_BROADCAST[] = "BROADCAST";
static const char __pyx_k_CarpState[] = "CarpState";
static const char __pyx_k_DEPARTURE[] = "DEPARTURE";
static const char __pyx_k_DS0BUNDLE[] = "DS0BUNDLE";
static const char __pyx_k_DVBASIOUT[] = "DVBASIOUT";
static const char __pyx_k_FASTETHER[] = "FASTETHER";
static const char __pyx_k_FRELAYDCE[] = "FRELAYDCE";
static const char __pyx_k_FRFORWARD[] = "FRFORWARD";
static const char __pyx_k_G703AT2MB[] = "G703AT2MB";
static const char __pyx_k_G703AT64K[] = "G703AT64K";
static const char __pyx_k_H323PROXY[] = "H323PROXY";
static const char __pyx_k_HIPERLAN2[] = "HIPERLAN2";
static const char __pyx_k_IEEE80211[] = "IEEE80211";
static const char __pyx_k_IEEE80212[] = "IEEE80212";
static const char __pyx_k_INET6_SDP[] = "INET6_SDP";
static const char __pyx_k_IPFORWARD[] = "IPFORWARD";
static const char __pyx_k_IPOVERATM[] = "IPOVERATM";
static const char __pyx_k_ISDNBASIC[] = "ISDNBASIC";
static const char __pyx_k_JUMBO_MTU[] = "JUMBO_MTU";
static const char __pyx_k_L3IPXVLAN[] = "L3IPXVLAN";
static const char __pyx_k_LINKSTATE[] = "LINKSTATE";
static const char __pyx_k_LOCALTALK[] = "LOCALTALK";
static const char __pyx_k_MFSIGLINK[] = "MFSIGLINK";
static const char __pyx_k_MULTICAST[] = "MULTICAST";
static const char __pyx_k_PTPSERIAL[] = "PTPSERIAL";
static const char __pyx_k_SONETPATH[] = "SONETPATH";
static const char __pyx_k_STATICARP[] = "STATICARP";
static const char __pyx_k_TEMPORARY[] = "TEMPORARY";
static const char __pyx_k_TENTATIVE[] = "TENTATIVE";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_WOL_MAGIC[] = "WOL_MAGIC";
static const char __pyx_k_WOL_MCAST[] = "WOL_MCAST";
static const char __pyx_k_WOL_UCAST[] = "WOL_UCAST";
static const char __pyx_k_addresses[] = "addresses";
static const char __pyx_k_as_buffer[] = "as_buffer";
static const char __pyx_k_broadcast[] = "broadcast";
static const char __pyx_k_exc_frame[] = "exc_frame";
static const char __pyx_k_groupname[] = "groupname";
static const char __pyx_k_interface[] = "interface";
static const char __pyx_k_ipaddress[] = "ipaddress";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nd6_flags[] = "nd6_flags";
static const char __pyx_k_AFLANE8023[] = "AFLANE8023";
static const char __pyx_k_AFLANE8025[] = "AFLANE8025";
static const char __pyx_k_ARCNETPLUS[] = "ARCNETPLUS";
static const char __pyx_k_ATMLOGICAL[] = "ATMLOGICAL";
static const char __pyx_k_ATMVIRTUAL[] = "ATMVIRTUAL";
static const char __pyx_k_CANTCONFIG[] = "CANTCONFIG";
static const char __pyx_k_COLLECTING[] = "COLLECTING";
static const char __pyx_k_CarpConfig[] = "CarpConfig";
static const char __pyx_k_DEPRECATED[] = "DEPRECATED";
static const char __pyx_k_DUPLICATED[] = "DUPLICATED";
static const char __pyx_k_IFANNOUNCE[] = "IFANNOUNCE";
static const char __pyx_k_IFDISABLED[] = "IFDISABLED";
static const char __pyx_k_INFINIBAND[] = "INFINIBAND";
static const char __pyx_k_INTERLEAVE[] = "INTERLEAVE";
static const char __pyx_k_IPOVERCDLC[] = "IPOVERCDLC";
static const char __pyx_k_IPOVERCLAW[] = "IPOVERCLAW";
static const char __pyx_k_MPLSTUNNEL[] = "MPLSTUNNEL";
static const char __pyx_k_PERFORMNUD[] = "PERFORMNUD";
static const char __pyx_k_ROUNDROBIN[] = "ROUNDROBIN";
static const char __pyx_k_RouteFlags[] = "RouteFlags";
static const char __pyx_k_Route___eq[] = "Route.__eq__";
static const char __pyx_k_Route___ne[] = "Route.__ne__";
static const char __pyx_k_SOCK_DGRAM[] = "SOCK_DGRAM";
static const char __pyx_k_SS7SIGLINK[] = "SS7SIGLINK";
static const char __pyx_k_TRANSPHDLC[] = "TRANSPHDLC";
static const char __pyx_k_VLAN_HWTSO[] = "VLAN_HWTSO";
static const char __pyx_k_VOICEENCAP[] = "VOICEENCAP";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_WrapSocket[] = "WrapSocket";
static const char __pyx_k_force_type[] = "force_type";
static const char __pyx_k_ip_address[] = "ip_address";
static const char __pyx_k_ipv6_flags[] = "ipv6_flags";
static const char __pyx_k_link_state[] = "link_state";
static const char __pyx_k_media_type[] = "media_type";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_send_route[] = "__send_route";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_ATMVCIENDPT[] = "ATMVCIENDPT";
static const char __pyx_k_DRV_OACTIVE[] = "DRV_OACTIVE";
static const char __pyx_k_DRV_RUNNING[] = "DRV_RUNNING";
static const char __pyx_k_FASTETHERFX[] = "FASTETHERFX";
static const char __pyx_k_FRDLCIENDPT[] = "FRDLCIENDPT";
static const char __pyx_k_ISDNPRIMARY[] = "ISDNPRIMARY";
static const char __pyx_k_ISO88022LLC[] = "ISO88022LLC";
static const char __pyx_k_ISO88025DTR[] = "ISO88025DTR";
static const char __pyx_k_LOADBALANCE[] = "LOADBALANCE";
static const char __pyx_k_LinkAddress[] = "LinkAddress";
static const char __pyx_k_POINTOPOINT[] = "POINTOPOINT";
static const char __pyx_k_PROPBWAP2MP[] = "PROPBWAP2MP";
static const char __pyx_k_PROPVIRTUAL[] = "PROPVIRTUAL";
static const char __pyx_k_RXCSUM_IPV6[] = "RXCSUM_IPV6";
static const char __pyx_k_SOCK_STREAM[] = "SOCK_STREAM";
static const char __pyx_k_TXCSUM_IPV6[] = "TXCSUM_IPV6";
static const char __pyx_k_VLAN_HWCSUM[] = "VLAN_HWCSUM";
static const char __pyx_k_VOICEOVERIP[] = "VOICEOVERIP";
static const char __pyx_k_add_address[] = "add_address";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_enumeration[] = "enumeration";
static const char __pyx_k_get_ifgroup[] = "get_ifgroup";
static const char __pyx_k_newhostname[] = "newhostname";
static const char __pyx_k_A12MPPSWITCH[] = "A12MPPSWITCH";
static const char __pyx_k_ACCEPT_RTADV[] = "ACCEPT_RTADV";
static const char __pyx_k_DISTRIBUTING[] = "DISTRIBUTING";
static const char __pyx_k_ETHERCHANNEL[] = "ETHERCHANNEL";
static const char __pyx_k_FIBRECHANNEL[] = "FIBRECHANNEL";
static const char __pyx_k_In6AddrFlags[] = "In6AddrFlags";
static const char __pyx_k_Route___hash[] = "Route.__hash__";
static const char __pyx_k_Route___init[] = "Route.__init__";
static const char __pyx_k_RoutingTable[] = "RoutingTable";
static const char __pyx_k_STACKTOSTACK[] = "STACKTOSTACK";
static const char __pyx_k_VOICEOVERATM[] = "VOICEOVERATM";
static const char __pyx_k_X25HUNTGROUP[] = "X25HUNTGROUP";
static const char __pyx_k_capabilities[] = "capabilities";
static const char __pyx_k_dest_address[] = "dest_address";
static const char __pyx_k_get_hostname[] = "get_hostname";
static const char __pyx_k_link_address[] = "link_address";
static const char __pyx_k_link_state_2[] = "link-state";
static const char __pyx_k_read_message[] = "read_message";
static const char __pyx_k_send_message[] = "__send_message";
static const char __pyx_k_set_hostname[] = "set_hostname";
static const char __pyx_k_AddressFamily[] = "AddressFamily";
static const char __pyx_k_COMPOSITELINK[] = "COMPOSITELINK";
static const char __pyx_k_FRAMERELAYMPI[] = "FRAMERELAYMPI";
static const char __pyx_k_IBM370PARCHAN[] = "IBM370PARCHAN";
static const char __pyx_k_IEEE8023ADLAG[] = "IEEE8023ADLAG";
static const char __pyx_k_IPv4Interface[] = "IPv4Interface";
static const char __pyx_k_IPv6Interface[] = "IPv6Interface";
static const char __pyx_k_ISO88025FIBER[] = "ISO88025FIBER";
static const char __pyx_k_InterfaceType[] = "InterfaceType";
static const char __pyx_k_LINK_STATE_UP[] = "LINK_STATE_UP";
static const char __pyx_k_LaggPortFlags[] = "LaggPortFlags";
static const char __pyx_k_PREFER_SOURCE[] = "PREFER_SOURCE";
static const char __pyx_k_RoutingSocket[] = "RoutingSocket";
static const char __pyx_k_VLAN_HWFILTER[] = "VLAN_HWFILTER";
static const char __pyx_k_default_route[] = "default_route";
static const char __pyx_k_get_interface[] = "get_interface";
static const char __pyx_k_media_options[] = "media_options";
static const char __pyx_k_media_subtype[] = "media_subtype";
static const char __pyx_k_newdomainname[] = "newdomainname";
static const char __pyx_k_static_routes[] = "static_routes";
static const char __pyx_k_write_message[] = "write_message";
static const char __pyx_k_AUTO_LINKLOCAL[] = "AUTO_LINKLOCAL";
static const char __pyx_k_DVBRCCMACLAYER[] = "DVBRCCMACLAYER";
static const char __pyx_k_DVBRCCUPSTREAM[] = "DVBRCCUPSTREAM";
static const char __pyx_k_FRF16MFRBUNDLE[] = "FRF16MFRBUNDLE";
static const char __pyx_k_H323GATEKEEPER[] = "H323GATEKEEPER";
static const char __pyx_k_HIPPIINTERFACE[] = "HIPPIINTERFACE";
static const char __pyx_k_InterfaceFlags[] = "InterfaceFlags";
static const char __pyx_k_OPTICALCHANNEL[] = "OPTICALCHANNEL";
static const char __pyx_k_VLAN_HWTAGGING[] = "VLAN_HWTAGGING";
static const char __pyx_k_bitmask_to_set[] = "bitmask_to_set";
static const char __pyx_k_dest_address_2[] = "dest-address";
static const char __pyx_k_get_domainname[] = "get_domainname";
static const char __pyx_k_remove_address[] = "remove_address";
static const char __pyx_k_set_domainname[] = "set_domainname";
static const char __pyx_k_set_to_bitmask[] = "set_to_bitmask";
static const char __pyx_k_ATMSUBINTERFACE[] = "ATMSUBINTERFACE";
static const char __pyx_k_CLONED_PREFIXES[] = "CLONED_PREFIXES";
static const char __pyx_k_GIGABITETHERNET[] = "GIGABITETHERNET";
static const char __pyx_k_ISO88025CRFPINT[] = "ISO88025CRFPINT";
static const char __pyx_k_LINK_STATE_DOWN[] = "LINK_STATE_DOWN";
static const char __pyx_k_MEDIAMAILOVERIP[] = "MEDIAMAILOVERIP";
static const char __pyx_k_NO_PREFER_IFACE[] = "NO_PREFER_IFACE";
static const char __pyx_k_POLLING_NOCOUNT[] = "POLLING_NOCOUNT";
static const char __pyx_k_PROPWIRELESSP2P[] = "PROPWIRELESSP2P";
static const char __pyx_k_list_interfaces[] = "list_interfaces";
static const char __pyx_k_DIGITALPOWERLINE[] = "DIGITALPOWERLINE";
static const char __pyx_k_DONT_SET_IFROUTE[] = "DONT_SET_IFROUTE";
static const char __pyx_k_DVBRCCDOWNSTREAM[] = "DVBRCCDOWNSTREAM";
static const char __pyx_k_InterfaceAddress[] = "InterfaceAddress";
static const char __pyx_k_LinkAddress___eq[] = "LinkAddress.__eq__";
static const char __pyx_k_LinkAddress___ne[] = "LinkAddress.__ne__";
static const char __pyx_k_OPTICALTRANSPORT[] = "OPTICALTRANSPORT";
static const char __pyx_k_Route___getstate[] = "Route.__getstate__";
static const char __pyx_k_RoutingTable_add[] = "RoutingTable.add";
static const char __pyx_k_VIRTUALIPADDRESS[] = "VIRTUALIPADDRESS";
static const char __pyx_k_create_interface[] = "create_interface";
static const char __pyx_k_CarpConfig___init[] = "CarpConfig.__init__";
static const char __pyx_k_DOCSCABLEMACLAYER[] = "DOCSCABLEMACLAYER";
static const char __pyx_k_DOCSCABLEUPSTREAM[] = "DOCSCABLEUPSTREAM";
static const char __pyx_k_LinkAddress___str[] = "LinkAddress.__str__";
static const char __pyx_k_WrapSocket___exit[] = "WrapSocket.__exit__";
static const char __pyx_k_active_media_type[] = "active_media_type";
static const char __pyx_k_broadcast_address[] = "broadcast_address";
static const char __pyx_k_destroy_interface[] = "destroy_interface";
static const char __pyx_k_InterfaceLinkState[] = "InterfaceLinkState";
static const char __pyx_k_LINK_STATE_UNKNOWN[] = "LINK_STATE_UNKNOWN";
static const char __pyx_k_LinkAddress___hash[] = "LinkAddress.__hash__";
static const char __pyx_k_LinkAddress___init[] = "LinkAddress.__init__";
static const char __pyx_k_PPPMULTILINKBUNDLE[] = "PPPMULTILINKBUNDLE";
static const char __pyx_k_RoutingMessageType[] = "RoutingMessageType";
static const char __pyx_k_RoutingSocket_open[] = "RoutingSocket.open";
static const char __pyx_k_WrapSocket___enter[] = "WrapSocket.__enter__";
static const char __pyx_k_default_route_ipv4[] = "default_route_ipv4";
static const char __pyx_k_default_route_ipv6[] = "default_route_ipv6";
static const char __pyx_k_AggregationProtocol[] = "AggregationProtocol";
static const char __pyx_k_BGPPOLICYACCOUNTING[] = "BGPPOLICYACCOUNTING";
static const char __pyx_k_DOCSCABLEDOWNSTREAM[] = "DOCSCABLEDOWNSTREAM";
static const char __pyx_k_InterfaceCapability[] = "InterfaceCapability";
static const char __pyx_k_LaggInterface___get[] = "LaggInterface.__get__";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_RoutingSocket_close[] = "RoutingSocket.close";
static const char __pyx_k_RoutingTable___init[] = "RoutingTable.__init__";
static const char __pyx_k_RoutingTable_change[] = "RoutingTable.change";
static const char __pyx_k_RoutingTable_delete[] = "RoutingTable.delete";
static const char __pyx_k_RoutingTable_routes[] = "RoutingTable.routes";
static const char __pyx_k_VOICEOVERFRAMERELAY[] = "VOICEOVERFRAMERELAY";
static const char __pyx_k_InterfaceMediaOption[] = "InterfaceMediaOption";
static const char __pyx_k_RoutingSocket___init[] = "RoutingSocket.__init__";
static const char __pyx_k_SONETOVERHEADCHANNEL[] = "SONETOVERHEADCHANNEL";
static const char __pyx_k_active_media_subtype[] = "active_media_subtype";
static const char __pyx_k_BridgeInterface___get[] = "BridgeInterface.__get__";
static const char __pyx_k_InterfaceAddress___eq[] = "InterfaceAddress.__eq__";
static const char __pyx_k_InterfaceAddress___ne[] = "InterfaceAddress.__ne__";
static const char __pyx_k_InterfaceAnnounceType[] = "InterfaceAnnounceType";
static const char __pyx_k_netif_0_name_1_type_2[] = "<netif.{0} name '{1}' type '{2}'>";
static const char __pyx_k_FRAMERELAYINTERCONNECT[] = "FRAMERELAYINTERCONNECT";
static const char __pyx_k_InterfaceAddress___str[] = "InterfaceAddress.__str__";
static const char __pyx_k_LinkAddress___getstate[] = "LinkAddress.__getstate__";
static const char __pyx_k_NeighborDiscoveryFlags[] = "NeighborDiscoveryFlags";
static const char __pyx_k_NetworkInterface___get[] = "NetworkInterface.__get__";
static const char __pyx_k_InterfaceAddress___hash[] = "InterfaceAddress.__hash__";
static const char __pyx_k_InterfaceAddress___init[] = "InterfaceAddress.__init__";
static const char __pyx_k_PROPDOCSWIRELESSMACLAYER[] = "PROPDOCSWIRELESSMACLAYER";
static const char __pyx_k_PROPDOCSWIRELESSUPSTREAM[] = "PROPDOCSWIRELESSUPSTREAM";
static const char __pyx_k_RoutingTable__send_route[] = "_RoutingTable__send_route";
static const char __pyx_k_RoutingTable___send_route[] = "RoutingTable.__send_route";
static const char __pyx_k_PROPDOCSWIRELESSDOWNSTREAM[] = "PROPDOCSWIRELESSDOWNSTREAM";
static const char __pyx_k_RoutingSocket_read_message[] = "RoutingSocket.read_message";
static const char __pyx_k_RoutingTable__send_message[] = "_RoutingTable__send_message";
static const char __pyx_k_RoutingTable_default_route[] = "RoutingTable.default_route";
static const char __pyx_k_RoutingTable_static_routes[] = "RoutingTable.static_routes";
static const char __pyx_k_InterfaceAddress___getstate[] = "InterfaceAddress.__getstate__";
static const char __pyx_k_RoutingSocket_write_message[] = "RoutingSocket.write_message";
static const char __pyx_k_RoutingTable___send_message[] = "RoutingTable.__send_message";
static const char __pyx_k_DIGITALWRAPPEROVERHEADCHANNEL[] = "DIGITALWRAPPEROVERHEADCHANNEL";
static const char __pyx_k_wrkdirs_usr_ports_net_py_netif[] = "/wrkdirs/usr/ports/net/py-netif/work/py-netif-2453794/netif.pyx";
static const char __pyx_k_NetworkInterface___get___locals[] = "NetworkInterface.__get__.<locals>.<lambda>";
static const char __pyx_k_RoutingTable_default_route_ipv4[] = "RoutingTable.default_route_ipv4.<locals>.<lambda>";
static const char __pyx_k_RoutingTable_default_route_ipv6[] = "RoutingTable.default_route_ipv6.<locals>.<lambda>";
static const char __pyx_k_get_interface_got_an_unexpected[] = "get_interface() got an unexpected keyword argument: ";
static const char __pyx_k_list_interfaces_internal_locals[] = "list_interfaces_internal.<locals>.genexpr";
static const char __pyx_k_RoutingTable_default_route_local[] = "RoutingTable.default_route.<locals>.<lambda>";
static const char __pyx_k_RoutingTable_static_routes_local[] = "RoutingTable.static_routes.<locals>.<lambda>";
static const char __pyx_k_RoutingTable_default_route_ipv4_2[] = "RoutingTable.default_route_ipv4";
static const char __pyx_k_RoutingTable_default_route_ipv6_2[] = "RoutingTable.default_route_ipv6";
static PyObject *__pyx_kp_s_0_02x;
static PyObject *__pyx_kp_u_0_0_0_0;
static PyObject *__pyx_kp_u_0_1;
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_A12MPPSWITCH;
static PyObject *__pyx_n_s_AAL2;
static PyObject *__pyx_n_s_AAL5;
static PyObject *__pyx_n_s_ACCEPT_RTADV;
static PyObject *__pyx_n_s_ACTIVE;
static PyObject *__pyx_n_s_ADD;
static PyObject *__pyx_n_s_ADSL;
static PyObject *__pyx_n_s_AFLANE8023;
static PyObject *__pyx_n_s_AFLANE8025;
static PyObject *__pyx_n_s_AF_INET;
static PyObject *__pyx_n_s_AF_INET6;
static PyObject *__pyx_n_s_AF_ROUTE;
static PyObject *__pyx_n_s_AF_UNIX;
static PyObject *__pyx_n_s_ALLMULTI;
static PyObject *__pyx_n_s_ANYCAST;
static PyObject *__pyx_n_s_APPLETALK;
static PyObject *__pyx_n_s_ARAP;
static PyObject *__pyx_n_s_ARCNET;
static PyObject *__pyx_n_s_ARCNETPLUS;
static PyObject *__pyx_n_s_ARP;
static PyObject *__pyx_n_s_ARRIVAL;
static PyObject *__pyx_n_s_ASYNC;
static PyObject *__pyx_n_s_ATM;
static PyObject *__pyx_n_s_ATMDXI;
static PyObject *__pyx_n_s_ATMFUNI;
static PyObject *__pyx_n_s_ATMIMA;
static PyObject *__pyx_n_s_ATMLOGICAL;
static PyObject *__pyx_n_s_ATMRADIO;
static PyObject *__pyx_n_s_ATMSUBINTERFACE;
static PyObject *__pyx_n_s_ATMVCIENDPT;
static PyObject *__pyx_n_s_ATMVIRTUAL;
static PyObject *__pyx_n_s_AUTO;
static PyObject *__pyx_n_s_AUTOCONF;
static PyObject *__pyx_n_s_AUTO_LINKLOCAL;
static PyObject *__pyx_n_s_AddressFamily;
static PyObject *__pyx_n_s_AggregationProtocol;
static PyObject *__pyx_n_s_BACKUP;
static PyObject *__pyx_n_s_BGPPOLICYACCOUNTING;
static PyObject *__pyx_n_s_BLACKHOLE;
static PyObject *__pyx_n_s_BLUETOOTH;
static PyObject *__pyx_n_s_BRIDGE;
static PyObject *__pyx_n_s_BROADCAST;
static PyObject *__pyx_n_s_BSC;
static PyObject *__pyx_n_s_BridgeInterface___get;
static PyObject *__pyx_n_s_CANTCONFIG;
static PyObject *__pyx_n_s_CCITT;
static PyObject *__pyx_n_s_CCTEMUL;
static PyObject *__pyx_n_s_CEPT;
static PyObject *__pyx_n_s_CES;
static PyObject *__pyx_n_s_CHANGE;
static PyObject *__pyx_n_s_CHANNEL;
static PyObject *__pyx_n_s_CHAOS;
static PyObject *__pyx_n_s_CLONED_PREFIXES;
static PyObject *__pyx_n_s_CNR;
static PyObject *__pyx_n_s_CNT;
static PyObject *__pyx_n_s_COFFEE;
static PyObject *__pyx_n_s_COIP;
static PyObject *__pyx_n_s_COLLECTING;
static PyObject *__pyx_n_s_COMPOSITELINK;
static PyObject *__pyx_n_s_CarpConfig;
static PyObject *__pyx_n_s_CarpConfig___init;
static PyObject *__pyx_n_s_CarpState;
static PyObject *__pyx_n_s_DATAKIT;
static PyObject *__pyx_n_s_DCN;
static PyObject *__pyx_n_s_DEBUG;
static PyObject *__pyx_n_s_DECnet;
static PyObject *__pyx_n_s_DELADDR;
static PyObject *__pyx_n_s_DELETE;
static PyObject *__pyx_n_s_DELMADDR;
static PyObject *__pyx_n_s_DEPARTURE;
static PyObject *__pyx_n_s_DEPRECATED;
static PyObject *__pyx_n_s_DETACHED;
static PyObject *__pyx_n_s_DIGITALPOWERLINE;
static PyObject *__pyx_n_s_DIGITALWRAPPEROVERHEADCHANNEL;
static PyObject *__pyx_n_s_DISABLED;
static PyObject *__pyx_n_s_DISTRIBUTING;
static PyObject *__pyx_n_s_DLI;
static PyObject *__pyx_n_s_DLSW;
static PyObject *__pyx_n_s_DOCSCABLEDOWNSTREAM;
static PyObject *__pyx_n_s_DOCSCABLEMACLAYER;
static PyObject *__pyx_n_s_DOCSCABLEUPSTREAM;
static PyObject *__pyx_n_s_DONE;
static PyObject *__pyx_n_s_DONT_SET_IFROUTE;
static PyObject *__pyx_n_s_DRV_OACTIVE;
static PyObject *__pyx_n_s_DRV_RUNNING;
static PyObject *__pyx_n_s_DS0;
static PyObject *__pyx_n_s_DS0BUNDLE;
static PyObject *__pyx_n_s_DS1FDL;
static PyObject *__pyx_n_s_DS3;
static PyObject *__pyx_n_s_DTM;
static PyObject *__pyx_n_s_DUPLICATED;
static PyObject *__pyx_n_s_DVBASILN;
static PyObject *__pyx_n_s_DVBASIOUT;
static PyObject *__pyx_n_s_DVBRCCDOWNSTREAM;
static PyObject *__pyx_n_s_DVBRCCMACLAYER;
static PyObject *__pyx_n_s_DVBRCCUPSTREAM;
static PyObject *__pyx_n_s_DYING;
static PyObject *__pyx_n_s_DYNAMIC;
static PyObject *__pyx_n_s_E164;
static PyObject *__pyx_n_s_ECMA;
static PyObject *__pyx_n_s_ENC;
static PyObject *__pyx_n_s_EON;
static PyObject *__pyx_n_s_EPLRS;
static PyObject *__pyx_n_s_ESCON;
static PyObject *__pyx_n_s_ETHER;
static PyObject *__pyx_n_s_ETHERCHANNEL;
static PyObject *__pyx_n_s_FAILOVER;
static PyObject *__pyx_n_s_FAST;
static PyObject *__pyx_n_s_FASTETHER;
static PyObject *__pyx_n_s_FASTETHERFX;
static PyObject *__pyx_n_s_FDDI;
static PyObject *__pyx_n_s_FDX;
static PyObject *__pyx_n_s_FIBRECHANNEL;
static PyObject *__pyx_n_s_FLAG0;
static PyObject *__pyx_n_s_FLAG1;
static PyObject *__pyx_n_s_FLAG2;
static PyObject *__pyx_n_s_FLOW;
static PyObject *__pyx_n_s_FRAMERELAYINTERCONNECT;
static PyObject *__pyx_n_s_FRAMERELAYMPI;
static PyObject *__pyx_n_s_FRDLCIENDPT;
static PyObject *__pyx_n_s_FRELAY;
static PyObject *__pyx_n_s_FRELAYDCE;
static PyObject *__pyx_n_s_FRF16MFRBUNDLE;
static PyObject *__pyx_n_s_FRFORWARD;
static PyObject *__pyx_n_s_G703AT2MB;
static PyObject *__pyx_n_s_G703AT64K;
static PyObject *__pyx_n_s_GATEWAY;
static PyObject *__pyx_n_s_GET;
static PyObject *__pyx_n_s_GIF;
static PyObject *__pyx_n_s_GIGABITETHERNET;
static PyObject *__pyx_n_s_GR303IDT;
static PyObject *__pyx_n_s_GR303RDT;
static PyObject *__pyx_n_s_H323GATEKEEPER;
static PyObject *__pyx_n_s_H323PROXY;
static PyObject *__pyx_n_s_HDH1822;
static PyObject *__pyx_n_s_HDLC;
static PyObject *__pyx_n_s_HDSL2;
static PyObject *__pyx_n_s_HDX;
static PyObject *__pyx_n_s_HIPERLAN2;
static PyObject *__pyx_n_s_HIPPI;
static PyObject *__pyx_n_s_HIPPIINTERFACE;
static PyObject *__pyx_n_s_HOST;
static PyObject *__pyx_n_s_HOSTPAD;
static PyObject *__pyx_n_s_HSSI;
static PyObject *__pyx_n_s_HWSTATS;
static PyObject *__pyx_n_s_HY;
static PyObject *__pyx_n_s_HYLINK;
static PyObject *__pyx_n_s_I1822;
static PyObject *__pyx_n_s_IBM370PARCHAN;
static PyObject *__pyx_n_s_IDSL;
static PyObject *__pyx_n_s_IEEE1394;
static PyObject *__pyx_n_s_IEEE80211;
static PyObject *__pyx_n_s_IEEE80212;
static PyObject *__pyx_n_s_IEEE8023ADLAG;
static PyObject *__pyx_n_s_IFANNOUNCE;
static PyObject *__pyx_n_s_IFDISABLED;
static PyObject *__pyx_n_s_IFGSN;
static PyObject *__pyx_n_s_IFINFO;
static PyObject *__pyx_n_s_IMPLINK;
static PyObject *__pyx_n_s_IMT;
static PyObject *__pyx_n_s_INET;
static PyObject *__pyx_n_s_INET6;
static PyObject *__pyx_n_s_INET6_SDP;
static PyObject *__pyx_n_s_INET_SDP;
static PyObject *__pyx_n_s_INFINIBAND;
static PyObject *__pyx_n_s_INIT;
static PyObject *__pyx_n_s_INTERLEAVE;
static PyObject *__pyx_n_s_INVALID;
static PyObject *__pyx_n_s_IP;
static PyObject *__pyx_n_s_IPFORWARD;
static PyObject *__pyx_n_s_IPOVERATM;
static PyObject *__pyx_n_s_IPOVERCDLC;
static PyObject *__pyx_n_s_IPOVERCLAW;
static PyObject *__pyx_n_s_IPSWITCH;
static PyObject *__pyx_n_s_IPX;
static PyObject *__pyx_n_s_IPv4Interface;
static PyObject *__pyx_n_s_IPv6Interface;
static PyObject *__pyx_n_s_ISDN;
static PyObject *__pyx_n_s_ISDNBASIC;
static PyObject *__pyx_n_s_ISDNPRIMARY;
static PyObject *__pyx_n_s_ISDNS;
static PyObject *__pyx_n_s_ISDNU;
static PyObject *__pyx_n_s_ISO;
static PyObject *__pyx_n_s_ISO88022LLC;
static PyObject *__pyx_n_s_ISO88023;
static PyObject *__pyx_n_s_ISO88024;
static PyObject *__pyx_n_s_ISO88025;
static PyObject *__pyx_n_s_ISO88025CRFPINT;
static PyObject *__pyx_n_s_ISO88025DTR;
static PyObject *__pyx_n_s_ISO88025FIBER;
static PyObject *__pyx_n_s_ISO88026;
static PyObject *__pyx_n_s_ISUP;
static PyObject *__pyx_n_s_In6AddrFlags;
static PyObject *__pyx_n_s_IntEnum;
static PyObject *__pyx_n_s_InterfaceAddress;
static PyObject *__pyx_n_s_InterfaceAddress___eq;
static PyObject *__pyx_n_s_InterfaceAddress___getstate;
static PyObject *__pyx_n_s_InterfaceAddress___hash;
static PyObject *__pyx_n_s_InterfaceAddress___init;
static PyObject *__pyx_n_s_InterfaceAddress___ne;
static PyObject *__pyx_n_s_InterfaceAddress___str;
static PyObject *__pyx_n_s_InterfaceAnnounceType;
static PyObject *__pyx_n_s_InterfaceCapability;
static PyObject *__pyx_n_s_InterfaceFlags;
static PyObject *__pyx_n_s_InterfaceLinkState;
static PyObject *__pyx_n_s_InterfaceMediaOption;
static PyObject *__pyx_n_s_InterfaceType;
static PyObject *__pyx_n_s_JUMBO_MTU;
static PyObject *__pyx_n_s_L2VLAN;
static PyObject *__pyx_n_s_L3IPVLAN;
static PyObject *__pyx_n_s_L3IPXVLAN;
static PyObject *__pyx_n_s_LACP;
static PyObject *__pyx_n_s_LAPB;
static PyObject *__pyx_n_s_LAPD;
static PyObject *__pyx_n_s_LAPF;
static PyObject *__pyx_n_s_LAT;
static PyObject *__pyx_n_s_LINK;
static PyObject *__pyx_n_s_LINK0;
static PyObject *__pyx_n_s_LINK1;
static PyObject *__pyx_n_s_LINK2;
static PyObject *__pyx_n_s_LINKSTATE;
static PyObject *__pyx_n_s_LINK_STATE_DOWN;
static PyObject *__pyx_n_s_LINK_STATE_UNKNOWN;
static PyObject *__pyx_n_s_LINK_STATE_UP;
static PyObject *__pyx_n_s_LLDATA;
static PyObject *__pyx_n_s_LLINFO;
static PyObject *__pyx_n_s_LOADBALANCE;
static PyObject *__pyx_n_s_LOCAL;
static PyObject *__pyx_n_s_LOCALTALK;
static PyObject *__pyx_n_s_LOCK;
static PyObject *__pyx_n_s_LOOP;
static PyObject *__pyx_n_s_LOOPBACK;
static PyObject *__pyx_n_s_LOSING;
static PyObject *__pyx_n_s_LRO;
static PyObject *__pyx_n_s_LaggInterface___get;
static PyObject *__pyx_n_s_LaggPortFlags;
static PyObject *__pyx_n_s_LinkAddress;
static PyObject *__pyx_n_s_LinkAddress___eq;
static PyObject *__pyx_n_s_LinkAddress___getstate;
static PyObject *__pyx_n_s_LinkAddress___hash;
static PyObject *__pyx_n_s_LinkAddress___init;
static PyObject *__pyx_n_s_LinkAddress___ne;
static PyObject *__pyx_n_s_LinkAddress___str;
static PyObject *__pyx_n_s_MANUAL;
static PyObject *__pyx_n_s_MASTER;
static PyObject *__pyx_n_s_MEDIAMAILOVERIP;
static PyObject *__pyx_n_s_MFSIGLINK;
static PyObject *__pyx_n_s_MIOX25;
static PyObject *__pyx_n_s_MISS;
static PyObject *__pyx_n_s_MODEM;
static PyObject *__pyx_n_s_MODIFIED;
static PyObject *__pyx_n_s_MONITOR;
static PyObject *__pyx_n_s_MPC;
static PyObject *__pyx_n_s_MPLS;
static PyObject *__pyx_n_s_MPLSTUNNEL;
static PyObject *__pyx_n_s_MSDSL;
static PyObject *__pyx_n_s_MULTICAST;
static PyObject *__pyx_n_s_MVL;
static PyObject *__pyx_n_s_MYRINET;
static PyObject *__pyx_n_s_NATM;
static PyObject *__pyx_n_s_NETBIOS;
static PyObject *__pyx_n_s_NETCONS;
static PyObject *__pyx_n_s_NETGRAPH;
static PyObject *__pyx_n_s_NETMAP;
static PyObject *__pyx_n_s_NEWADDR;
static PyObject *__pyx_n_s_NEWMADDR;
static PyObject *__pyx_n_s_NFAS;
static PyObject *__pyx_n_s_NOARP;
static PyObject *__pyx_n_s_NONE;
static PyObject *__pyx_n_s_NO_PREFER_IFACE;
static PyObject *__pyx_n_s_NO_RADR;
static PyObject *__pyx_n_s_NSIP;
static PyObject *__pyx_n_s_NeighborDiscoveryFlags;
static PyObject *__pyx_n_s_NetworkInterface___get;
static PyObject *__pyx_n_s_NetworkInterface___get___locals;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_OPTICALCHANNEL;
static PyObject *__pyx_n_s_OPTICALTRANSPORT;
static PyObject *__pyx_n_s_OSError;
static PyObject *__pyx_n_s_OSI;
static PyObject *__pyx_n_s_OTHER;
static PyObject *__pyx_n_s_P10;
static PyObject *__pyx_n_s_P80;
static PyObject *__pyx_n_s_PARA;
static PyObject *__pyx_n_s_PERFORMNUD;
static PyObject *__pyx_n_s_PFLOG;
static PyObject *__pyx_n_s_PFSYNC;
static PyObject *__pyx_n_s_PINNED;
static PyObject *__pyx_n_s_PLC;
static PyObject *__pyx_n_s_POINTOPOINT;
static PyObject *__pyx_n_s_POLLING;
static PyObject *__pyx_n_s_POLLING_NOCOUNT;
static PyObject *__pyx_n_s_POS;
static PyObject *__pyx_n_s_PPP;
static PyObject *__pyx_n_s_PPPMULTILINKBUNDLE;
static PyObject *__pyx_n_s_PPROMISC;
static PyObject *__pyx_n_s_PREFER_SOURCE;
static PyObject *__pyx_n_s_PROMISC;
static PyObject *__pyx_n_s_PROPBWAP2MP;
static PyObject *__pyx_n_s_PROPCNLS;
static PyObject *__pyx_n_s_PROPDOCSWIRELESSDOWNSTREAM;
static PyObject *__pyx_n_s_PROPDOCSWIRELESSMACLAYER;
static PyObject *__pyx_n_s_PROPDOCSWIRELESSUPSTREAM;
static PyObject *__pyx_n_s_PROPMUX;
static PyObject *__pyx_n_s_PROPVIRTUAL;
static PyObject *__pyx_n_s_PROPWIRELESSP2P;
static PyObject *__pyx_n_s_PROTO1;
static PyObject *__pyx_n_s_PROTO2;
static PyObject *__pyx_n_s_PROTO3;
static PyObject *__pyx_n_s_PTPSERIAL;
static PyObject *__pyx_n_s_PUP;
static PyObject *__pyx_n_s_PVC;
static PyObject *__pyx_n_s_QLLC;
static PyObject *__pyx_n_s_RADIOMAC;
static PyObject *__pyx_n_s_RADSL;
static PyObject *__pyx_n_s_REACHDSL;
static PyObject *__pyx_n_s_REDIRECT;
static PyObject *__pyx_n_s_REJECT;
static PyObject *__pyx_n_s_RENAMING;
static PyObject *__pyx_n_s_RESOLVE;
static PyObject *__pyx_n_s_RFC1483;
static PyObject *__pyx_n_s_ROUNDROBIN;
static PyObject *__pyx_n_s_ROUTE;
static PyObject *__pyx_n_s_RS232;
static PyObject *__pyx_n_s_RSRB;
static PyObject *__pyx_n_s_RXCSUM;
static PyObject *__pyx_n_s_RXCSUM_IPV6;
static PyObject *__pyx_n_s_Route;
static PyObject *__pyx_n_s_RouteFlags;
static PyObject *__pyx_n_s_Route___eq;
static PyObject *__pyx_n_s_Route___getstate;
static PyObject *__pyx_n_s_Route___hash;
static PyObject *__pyx_n_s_Route___init;
static PyObject *__pyx_n_s_Route___ne;
static PyObject *__pyx_n_s_Route_af;
static PyObject *__pyx_n_s_RoutingMessageType;
static PyObject *__pyx_n_s_RoutingSocket;
static PyObject *__pyx_n_s_RoutingSocket___init;
static PyObject *__pyx_n_s_RoutingSocket_close;
static PyObject *__pyx_n_s_RoutingSocket_open;
static PyObject *__pyx_n_s_RoutingSocket_read_message;
static PyObject *__pyx_n_s_RoutingSocket_write_message;
static PyObject *__pyx_n_s_RoutingTable;
static PyObject *__pyx_n_s_RoutingTable___init;
static PyObject *__pyx_n_s_RoutingTable___send_message;
static PyObject *__pyx_n_s_RoutingTable___send_route;
static PyObject *__pyx_n_s_RoutingTable__send_message;
static PyObject *__pyx_n_s_RoutingTable__send_route;
static PyObject *__pyx_n_s_RoutingTable_add;
static PyObject *__pyx_n_s_RoutingTable_change;
static PyObject *__pyx_n_s_RoutingTable_default_route;
static PyObject *__pyx_n_s_RoutingTable_default_route_ipv4;
static PyObject *__pyx_n_s_RoutingTable_default_route_ipv4_2;
static PyObject *__pyx_n_s_RoutingTable_default_route_ipv6;
static PyObject *__pyx_n_s_RoutingTable_default_route_ipv6_2;
static PyObject *__pyx_n_s_RoutingTable_default_route_local;
static PyObject *__pyx_n_s_RoutingTable_delete;
static PyObject *__pyx_n_s_RoutingTable_routes;
static PyObject *__pyx_n_s_RoutingTable_static_routes;
static PyObject *__pyx_n_s_RoutingTable_static_routes_local;
static PyObject *__pyx_n_s_SCLUSTER;
static PyObject *__pyx_n_s_SDLC;
static PyObject *__pyx_n_s_SDSL;
static PyObject *__pyx_n_s_SHDSL;
static PyObject *__pyx_n_s_SIMPLEX;
static PyObject *__pyx_n_s_SIP;
static PyObject *__pyx_n_s_SLAVE;
static PyObject *__pyx_n_s_SLIP;
static PyObject *__pyx_n_s_SLOW;
static PyObject *__pyx_n_s_SMDSDXI;
static PyObject *__pyx_n_s_SMDSICIP;
static PyObject *__pyx_n_s_SNA;
static PyObject *__pyx_n_s_SOCK_DGRAM;
static PyObject *__pyx_n_s_SOCK_RAW;
static PyObject *__pyx_n_s_SOCK_STREAM;
static PyObject *__pyx_n_s_SONET;
static PyObject *__pyx_n_s_SONETOVERHEADCHANNEL;
static PyObject *__pyx_n_s_SONETPATH;
static PyObject *__pyx_n_s_SONETVT;
static PyObject *__pyx_n_s_SRP;
static PyObject *__pyx_n_s_SS7SIGLINK;
static PyObject *__pyx_n_s_STACK;
static PyObject *__pyx_n_s_STACKTOSTACK;
static PyObject *__pyx_n_s_STARLAN;
static PyObject *__pyx_n_s_STATIC;
static PyObject *__pyx_n_s_STATICARP;
static PyObject *__pyx_n_s_STF;
static PyObject *__pyx_n_s_STICKY;
static PyObject *__pyx_n_s_T1;
static PyObject *__pyx_n_s_TDLC;
static PyObject *__pyx_n_s_TEMPORARY;
static PyObject *__pyx_n_s_TENTATIVE;
static PyObject *__pyx_n_s_TERMPAD;
static PyObject *__pyx_n_s_TOE4;
static PyObject *__pyx_n_s_TOE6;
static PyObject *__pyx_n_s_TR008;
static PyObject *__pyx_n_s_TRANSPHDLC;
static PyObject *__pyx_n_s_TSO4;
static PyObject *__pyx_n_s_TSO6;
static PyObject *__pyx_n_s_TUNNEL;
static PyObject *__pyx_n_s_TXCSUM;
static PyObject *__pyx_n_s_TXCSUM_IPV6;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ULTRA;
static PyObject *__pyx_n_s_UNIX;
static PyObject *__pyx_n_s_UP;
static PyObject *__pyx_n_s_USB;
static PyObject *__pyx_n_s_V11;
static PyObject *__pyx_n_s_V35;
static PyObject *__pyx_n_s_V36;
static PyObject *__pyx_n_s_V37;
static PyObject *__pyx_n_s_VDSL;
static PyObject *__pyx_n_s_VIRTUALIPADDRESS;
static PyObject *__pyx_n_s_VLAN_HWCSUM;
static PyObject *__pyx_n_s_VLAN_HWFILTER;
static PyObject *__pyx_n_s_VLAN_HWTAGGING;
static PyObject *__pyx_n_s_VLAN_HWTSO;
static PyObject *__pyx_n_s_VLAN_MTU;
static PyObject *__pyx_n_s_VOICEEM;
static PyObject *__pyx_n_s_VOICEENCAP;
static PyObject *__pyx_n_s_VOICEFXO;
static PyObject *__pyx_n_s_VOICEFXS;
static PyObject *__pyx_n_s_VOICEOVERATM;
static PyObject *__pyx_n_s_VOICEOVERFRAMERELAY;
static PyObject *__pyx_n_s_VOICEOVERIP;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_WOL_MAGIC;
static PyObject *__pyx_n_s_WOL_MCAST;
static PyObject *__pyx_n_s_WOL_UCAST;
static PyObject *__pyx_n_s_WrapSocket;
static PyObject *__pyx_n_s_WrapSocket___enter;
static PyObject *__pyx_n_s_WrapSocket___exit;
static PyObject *__pyx_n_s_X213;
static PyObject *__pyx_n_s_X25;
static PyObject *__pyx_n_s_X25DDN;
static PyObject *__pyx_n_s_X25HUNTGROUP;
static PyObject *__pyx_n_s_X25MLP;
static PyObject *__pyx_n_s_X25PLE;
static PyObject *__pyx_n_s_XETHER;
static PyObject *__pyx_n_s_XRESOLVE;
static PyObject *__pyx_kp_s__15;
static PyObject *__pyx_kp_u__18;
static PyObject *__pyx_n_s_active_media_subtype;
static PyObject *__pyx_n_s_active_media_type;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_address;
static PyObject *__pyx_n_s_addr;
static PyObject *__pyx_n_s_address;
static PyObject *__pyx_n_s_addresses;
static PyObject *__pyx_n_s_advbase;
static PyObject *__pyx_n_s_advskew;
static PyObject *__pyx_n_s_af;
static PyObject *__pyx_n_s_aliases;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_as_buffer;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_bin;
static PyObject *__pyx_n_s_bitmask_to_set;
static PyObject *__pyx_n_s_bridge;
static PyObject *__pyx_n_s_broadcast;
static PyObject *__pyx_n_s_broadcast_address;
static PyObject *__pyx_n_s_bsd;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_capabilities;
static PyObject *__pyx_n_s_carp;
static PyObject *__pyx_n_s_change;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cloned;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_create_interface;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_default_route;
static PyObject *__pyx_n_s_default_route_ipv4;
static PyObject *__pyx_n_s_default_route_ipv6;
static PyObject *__pyx_n_s_delete;
static PyObject *__pyx_n_s_description;
static PyObject *__pyx_n_s_dest_address;
static PyObject *__pyx_kp_s_dest_address_2;
static PyObject *__pyx_n_s_destroy_interface;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enum;
static PyObject *__pyx_n_s_enumeration;
static PyObject *__pyx_n_s_epair;
static PyObject *__pyx_n_s_eq;
static PyObject *__pyx_n_s_errno;
static PyObject *__pyx_n_s_exc_frame;
static PyObject *__pyx_n_s_exc_type;
static PyObject *__pyx_n_s_exc_val;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_kp_s_fe80;
static PyObject *__pyx_n_s_fileno;
static PyObject *__pyx_n_s_filter;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_force_type;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_gateway;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_2;
static PyObject *__pyx_n_s_get_domainname;
static PyObject *__pyx_n_s_get_hostname;
static PyObject *__pyx_n_s_get_ifgroup;
static PyObject *__pyx_n_s_get_interface;
static PyObject *__pyx_kp_s_get_interface_got_an_unexpected;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_groupname;
static PyObject *__pyx_n_s_hash;
static PyObject *__pyx_n_s_htonl;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_ifa;
static PyObject *__pyx_n_s_ifg;
static PyObject *__pyx_n_s_ifgr;
static PyObject *__pyx_n_s_ifname;
static PyObject *__pyx_n_s_ifr;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_interface;
static PyObject *__pyx_n_s_ip;
static PyObject *__pyx_n_s_ip_address;
static PyObject *__pyx_n_s_ipaddress;
static PyObject *__pyx_n_s_ipv6_flags;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itype;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_lagg;
static PyObject *__pyx_n_s_len;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_link_address;
static PyObject *__pyx_n_s_link_state;
static PyObject *__pyx_kp_s_link_state_2;
static PyObject *__pyx_n_s_list_interfaces;
static PyObject *__pyx_n_s_list_interfaces_internal_locals;
static PyObject *__pyx_n_s_lo;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_media_options;
static PyObject *__pyx_n_s_media_subtype;
static PyObject *__pyx_n_s_media_type;
static PyObject *__pyx_n_s_mem;
static PyObject *__pyx_n_s_members;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_mtu;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_names;
static PyObject *__pyx_n_s_nd6_flags;
static PyObject *__pyx_n_s_ne;
static PyObject *__pyx_n_s_netif;
static PyObject *__pyx_kp_s_netif_0_name_1_type_2;
static PyObject *__pyx_n_s_netmask;
static PyObject *__pyx_n_s_network;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_newdomainname;
static PyObject *__pyx_n_s_newhostname;
static PyObject *__pyx_n_s_ntohl;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_packed;
static PyObject *__pyx_n_s_packet;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_popitem;
static PyObject *__pyx_n_s_ports;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_protocol;
static PyObject *__pyx_n_s_ptr;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_message;
static PyObject *__pyx_n_s_remove_address;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_ret;
static PyObject *__pyx_n_s_route;
static PyObject *__pyx_n_s_routes;
static PyObject *__pyx_n_s_rt_msg;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_n_s_scope;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_send_message;
static PyObject *__pyx_n_s_send_route;
static PyObject *__pyx_n_s_set_domainname;
static PyObject *__pyx_n_s_set_hostname;
static PyObject *__pyx_n_s_set_to_bitmask;
static PyObject *__pyx_n_s_sock;
static PyObject *__pyx_n_s_sock3;
static PyObject *__pyx_n_s_socket;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_static_routes;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_strerror;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sysctl;
static PyObject *__pyx_n_s_tag;
static PyObject *__pyx_n_s_tap;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tostring;
static PyObject *__pyx_n_s_tun;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_typemap;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_kp_s_utf_8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_vhid;
static PyObject *__pyx_n_s_vlan;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_write_message;
static PyObject *__pyx_kp_s_wrkdirs_usr_ports_net_py_netif;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_pf_5netif_11LinkAddress___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ifname, PyObject *__pyx_v_address); /* proto */
static PyObject *__pyx_pf_5netif_11LinkAddress_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_11LinkAddress_4__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_11LinkAddress_6__hash__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_11LinkAddress_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_5netif_11LinkAddress_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_5netif_16InterfaceAddress___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_af, PyObject *__pyx_v_address); /* proto */
static PyObject *__pyx_pf_5netif_16InterfaceAddress_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16InterfaceAddress_4__hash__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16InterfaceAddress_6__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16InterfaceAddress_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_5netif_16InterfaceAddress_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_5netif_10WrapSocket___enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_10WrapSocket_2__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_frame); /* proto */
static int __pyx_pf_5netif_16NetworkInterface___init__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_2__str__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_4__repr__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_6__getstate__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_6cloned___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_5flags___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_9nd6_flags___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_9nd6_flags_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_3mtu___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_3mtu_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_mtu); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_12capabilities___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_12capabilities_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_10link_state___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_12link_address___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_12link_address_2__set__(CYTHON_UNUSED struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_address); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_10media_type___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_17active_media_type___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_13media_subtype___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_13media_subtype_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_20active_media_subtype___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_13media_options___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_13media_options_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_11description___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_11description_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_descr); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_11carp_config___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_11carp_config_3__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_8add_address(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_address); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_10remove_address(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_address); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_12down(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_14up(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_16rename(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_4name___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_4type___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_4type_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5netif_16NetworkInterface_4type_4__del__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_16NetworkInterface_9addresses___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_10CarpConfig___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vhid, PyObject *__pyx_v_addr, PyObject *__pyx_v_advbase, PyObject *__pyx_v_advskew, PyObject *__pyx_v_key, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5netif_13LaggInterface___getstate__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13LaggInterface_2add_port(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_13LaggInterface_4delete_port(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_13LaggInterface_8protocol___get__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_13LaggInterface_8protocol_2__set__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_13LaggInterface_5ports___get__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_15BridgeInterface___getstate__(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_15BridgeInterface_2add_member(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_15BridgeInterface_4delete_member(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_15BridgeInterface_7members___get__(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13VlanInterface___getstate__(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13VlanInterface_2configure(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_tag); /* proto */
static PyObject *__pyx_pf_5netif_13VlanInterface_4unconfigure(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13VlanInterface_6parent___get__(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13VlanInterface_3tag___get__(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_13RoutingPacket___init__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingPacket_2__getstate__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingPacket_4type___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_13RoutingPacket_4type_2__set__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingPacket_7version___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingPacket_6length___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingPacket_4data___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_24InterfaceAnnounceMessage___init__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self, PyObject *__pyx_v_packet); /* proto */
static PyObject *__pyx_pf_5netif_24InterfaceAnnounceMessage_2__getstate__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_24InterfaceAnnounceMessage_9interface___get__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_24InterfaceAnnounceMessage_4type___get__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_20InterfaceInfoMessage___init__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self, PyObject *__pyx_v_packet); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_2__getstate__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_5flags___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_10link_state___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_3mtu___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_9interface___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_5addrs___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_20InterfaceAddrMessage___init__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self, PyObject *__pyx_v_packet); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_2__getstate__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_7address___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_7netmask___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_12dest_address___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_5flags___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_9interface___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_5addrs___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage___init__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_packet); /* proto */
static void __pyx_pf_5netif_14RoutingMessage_2__dealloc__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_4__getstate__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_6as_buffer(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_5errno___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_5flags___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage_5flags_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_9interface___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage_9interface_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_7network___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage_7network_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_7netmask___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage_7netmask_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_7gateway___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage_7gateway_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_5route___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static int __pyx_pf_5netif_14RoutingMessage_5route_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_pf_5netif_14RoutingMessage_5addrs___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_5Route___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_network, PyObject *__pyx_v_netmask, PyObject *__pyx_v_gateway, PyObject *__pyx_v_interface); /* proto */
static PyObject *__pyx_pf_5netif_5Route_2af(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_5Route_4__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_5Route_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_5netif_5Route_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_5netif_5Route_10__hash__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_2__send_message(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_4__send_route(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_6default_route_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_8default_route_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_10routes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_13default_route(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_15static_routes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_17add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_19delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_pf_5netif_12RoutingTable_21change(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_route); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingSocket___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingSocket_2open(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingSocket_4close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingSocket_6read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5netif_13RoutingSocket_8write_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_5netif_get_ifgroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_groupname); /* proto */
static PyObject *__pyx_pf_5netif_24list_interfaces_internal_genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5netif_24list_interfaces_internal_3genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5netif_24list_interfaces_internal_6genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5netif_2list_interfaces(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_names, PyObject *__pyx_v_typemap); /* proto */
static PyObject *__pyx_pf_5netif_4bitmask_to_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_enumeration); /* proto */
static PyObject *__pyx_pf_5netif_6set_to_bitmask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5netif_8get_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_force_type, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5netif_10create_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_12destroy_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5netif_14get_hostname(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5netif_16set_hostname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_newhostname); /* proto */
static PyObject *__pyx_pf_5netif_18get_domainname(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5netif_20set_domainname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_newdomainname); /* proto */
static PyObject *__pyx_tp_new_5netif_NetworkInterface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_LaggInterface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_BridgeInterface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_VlanInterface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_RoutingPacket(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_InterfaceAnnounceMessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_InterfaceInfoMessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_InterfaceAddrMessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif_RoutingMessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct____get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_1___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_2___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_3_routes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_1024;
static PyObject *__pyx_k__3;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__5;
static PyObject *__pyx_slice__6;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__44;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__113;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__121;
static PyObject *__pyx_codeobj__123;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__135;
static PyObject *__pyx_codeobj__137;
static PyObject *__pyx_codeobj__139;

/* "netif.pyx":470
 * 
 * class LinkAddress(object):
 *     def __init__(self, ifname=None, address=None):             # <<<<<<<<<<<<<<
 *         self.ifname = ifname
 *         self.address = address
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11LinkAddress_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_11LinkAddress_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5netif_11LinkAddress_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_11LinkAddress_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_ifname = 0;
  PyObject *__pyx_v_address = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ifname,&__pyx_n_s_address,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifname);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_address);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 470, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_ifname = values[1];
    __pyx_v_address = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 470, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.LinkAddress.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_11LinkAddress___init__(__pyx_self, __pyx_v_self, __pyx_v_ifname, __pyx_v_address);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_11LinkAddress___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ifname, PyObject *__pyx_v_address) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":471
 * class LinkAddress(object):
 *     def __init__(self, ifname=None, address=None):
 *         self.ifname = ifname             # <<<<<<<<<<<<<<
 *         self.address = address
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ifname, __pyx_v_ifname) < 0) __PYX_ERR(0, 471, __pyx_L1_error)

  /* "netif.pyx":472
 *     def __init__(self, ifname=None, address=None):
 *         self.ifname = ifname
 *         self.address = address             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_address, __pyx_v_address) < 0) __PYX_ERR(0, 472, __pyx_L1_error)

  /* "netif.pyx":470
 * 
 * class LinkAddress(object):
 *     def __init__(self, ifname=None, address=None):             # <<<<<<<<<<<<<<
 *         self.ifname = ifname
 *         self.address = address
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.LinkAddress.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":474
 *         self.address = address
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.address
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11LinkAddress_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_11LinkAddress_3__str__ = {"__str__", (PyCFunction)__pyx_pw_5netif_11LinkAddress_3__str__, METH_O, 0};
static PyObject *__pyx_pw_5netif_11LinkAddress_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_11LinkAddress_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_11LinkAddress_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "netif.pyx":475
 * 
 *     def __str__(self):
 *         return self.address             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":474
 *         self.address = address
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.address
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.LinkAddress.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":477
 *         return self.address
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'ifname': self.ifname,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11LinkAddress_5__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_11LinkAddress_5__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_5netif_11LinkAddress_5__getstate__, METH_O, 0};
static PyObject *__pyx_pw_5netif_11LinkAddress_5__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_11LinkAddress_4__getstate__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_11LinkAddress_4__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":478
 * 
 *     def __getstate__(self):
 *         return {             # <<<<<<<<<<<<<<
 *             'ifname': self.ifname,
 *             'address': self.address
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":479
 *     def __getstate__(self):
 *         return {
 *             'ifname': self.ifname,             # <<<<<<<<<<<<<<
 *             'address': self.address
 *         }
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ifname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ifname, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":480
 *         return {
 *             'ifname': self.ifname,
 *             'address': self.address             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_address, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":477
 *         return self.address
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'ifname': self.ifname,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.LinkAddress.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":483
 *         }
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.ifname, self.address))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11LinkAddress_7__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_11LinkAddress_7__hash__ = {"__hash__", (PyCFunction)__pyx_pw_5netif_11LinkAddress_7__hash__, METH_O, 0};
static PyObject *__pyx_pw_5netif_11LinkAddress_7__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_11LinkAddress_6__hash__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_11LinkAddress_6__hash__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "netif.pyx":484
 * 
 *     def __hash__(self):
 *         return hash((self.ifname, self.address))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ifname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_FromHash_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":483
 *         }
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.ifname, self.address))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.LinkAddress.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":486
 *         return hash((self.ifname, self.address))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.ifname == other.ifname and \
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11LinkAddress_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_11LinkAddress_9__eq__ = {"__eq__", (PyCFunction)__pyx_pw_5netif_11LinkAddress_9__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_11LinkAddress_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 486, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.LinkAddress.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_11LinkAddress_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_11LinkAddress_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "netif.pyx":487
 * 
 *     def __eq__(self, other):
 *         return \             # <<<<<<<<<<<<<<
 *             self.ifname == other.ifname and \
 *             self.address == other.address
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":488
 *     def __eq__(self, other):
 *         return \
 *             self.ifname == other.ifname and \             # <<<<<<<<<<<<<<
 *             self.address == other.address
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ifname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_ifname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "netif.pyx":489
 *         return \
 *             self.ifname == other.ifname and \
 *             self.address == other.address             # <<<<<<<<<<<<<<
 * 
 *     def __ne__(self, other):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":486
 *         return hash((self.ifname, self.address))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.ifname == other.ifname and \
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.LinkAddress.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":491
 *             self.address == other.address
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11LinkAddress_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_11LinkAddress_11__ne__ = {"__ne__", (PyCFunction)__pyx_pw_5netif_11LinkAddress_11__ne__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_11LinkAddress_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 491, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 491, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 491, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.LinkAddress.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_11LinkAddress_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_11LinkAddress_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "netif.pyx":492
 * 
 *     def __ne__(self, other):
 *         return not self == other             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":491
 *             self.address == other.address
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.LinkAddress.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":496
 * 
 * class InterfaceAddress(object):
 *     def __init__(self, af=None, address=None):             # <<<<<<<<<<<<<<
 *         self.af = af
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16InterfaceAddress_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16InterfaceAddress_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5netif_16InterfaceAddress_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_16InterfaceAddress_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_af = 0;
  PyObject *__pyx_v_address = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_af,&__pyx_n_s_address,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_af);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_address);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 496, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_af = values[1];
    __pyx_v_address = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 496, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.InterfaceAddress.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_16InterfaceAddress___init__(__pyx_self, __pyx_v_self, __pyx_v_af, __pyx_v_address);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16InterfaceAddress___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_af, PyObject *__pyx_v_address) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":497
 * class InterfaceAddress(object):
 *     def __init__(self, af=None, address=None):
 *         self.af = af             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(address, (ipaddress.IPv4Interface, ipaddress.IPv6Interface)):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_af, __pyx_v_af) < 0) __PYX_ERR(0, 497, __pyx_L1_error)

  /* "netif.pyx":499
 *         self.af = af
 * 
 *         if isinstance(address, (ipaddress.IPv4Interface, ipaddress.IPv6Interface)):             # <<<<<<<<<<<<<<
 *             self.address = address.ip
 *             self.netmask = address.netmask
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IPv4Interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IPv6Interface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_address, __pyx_t_2); 
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = PyObject_IsInstance(__pyx_v_address, __pyx_t_3); 
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "netif.pyx":500
 * 
 *         if isinstance(address, (ipaddress.IPv4Interface, ipaddress.IPv6Interface)):
 *             self.address = address.ip             # <<<<<<<<<<<<<<
 *             self.netmask = address.netmask
 *             self.broadcast = address.network.broadcast_address
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_address, __pyx_t_2) < 0) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "netif.pyx":501
 *         if isinstance(address, (ipaddress.IPv4Interface, ipaddress.IPv6Interface)):
 *             self.address = address.ip
 *             self.netmask = address.netmask             # <<<<<<<<<<<<<<
 *             self.broadcast = address.network.broadcast_address
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_netmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_netmask, __pyx_t_2) < 0) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "netif.pyx":502
 *             self.address = address.ip
 *             self.netmask = address.netmask
 *             self.broadcast = address.network.broadcast_address             # <<<<<<<<<<<<<<
 *         else:
 *             self.address = address
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_broadcast_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_broadcast, __pyx_t_3) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":499
 *         self.af = af
 * 
 *         if isinstance(address, (ipaddress.IPv4Interface, ipaddress.IPv6Interface)):             # <<<<<<<<<<<<<<
 *             self.address = address.ip
 *             self.netmask = address.netmask
 */
    goto __pyx_L3;
  }

  /* "netif.pyx":504
 *             self.broadcast = address.network.broadcast_address
 *         else:
 *             self.address = address             # <<<<<<<<<<<<<<
 *             self.netmask = None
 *             self.broadcast = None
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_address, __pyx_v_address) < 0) __PYX_ERR(0, 504, __pyx_L1_error)

    /* "netif.pyx":505
 *         else:
 *             self.address = address
 *             self.netmask = None             # <<<<<<<<<<<<<<
 *             self.broadcast = None
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_netmask, Py_None) < 0) __PYX_ERR(0, 505, __pyx_L1_error)

    /* "netif.pyx":506
 *             self.address = address
 *             self.netmask = None
 *             self.broadcast = None             # <<<<<<<<<<<<<<
 * 
 *         self.dest_address = None
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_broadcast, Py_None) < 0) __PYX_ERR(0, 506, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "netif.pyx":508
 *             self.broadcast = None
 * 
 *         self.dest_address = None             # <<<<<<<<<<<<<<
 *         self.scope = None
 *         self.ipv6_flags = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dest_address, Py_None) < 0) __PYX_ERR(0, 508, __pyx_L1_error)

  /* "netif.pyx":509
 * 
 *         self.dest_address = None
 *         self.scope = None             # <<<<<<<<<<<<<<
 *         self.ipv6_flags = None
 *         self.vhid = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scope, Py_None) < 0) __PYX_ERR(0, 509, __pyx_L1_error)

  /* "netif.pyx":510
 *         self.dest_address = None
 *         self.scope = None
 *         self.ipv6_flags = None             # <<<<<<<<<<<<<<
 *         self.vhid = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ipv6_flags, Py_None) < 0) __PYX_ERR(0, 510, __pyx_L1_error)

  /* "netif.pyx":511
 *         self.scope = None
 *         self.ipv6_flags = None
 *         self.vhid = None             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vhid, Py_None) < 0) __PYX_ERR(0, 511, __pyx_L1_error)

  /* "netif.pyx":496
 * 
 * class InterfaceAddress(object):
 *     def __init__(self, af=None, address=None):             # <<<<<<<<<<<<<<
 *         self.af = af
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.InterfaceAddress.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":513
 *         self.vhid = None
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16InterfaceAddress_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16InterfaceAddress_3__str__ = {"__str__", (PyCFunction)__pyx_pw_5netif_16InterfaceAddress_3__str__, METH_O, 0};
static PyObject *__pyx_pw_5netif_16InterfaceAddress_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16InterfaceAddress_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16InterfaceAddress_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "netif.pyx":514
 * 
 *     def __str__(self):
 *         return u'{0}/{1}'.format(self.address, self.netmask)             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":513
 *         self.vhid = None
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.InterfaceAddress.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":516
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16InterfaceAddress_5__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16InterfaceAddress_5__hash__ = {"__hash__", (PyCFunction)__pyx_pw_5netif_16InterfaceAddress_5__hash__, METH_O, 0};
static PyObject *__pyx_pw_5netif_16InterfaceAddress_5__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16InterfaceAddress_4__hash__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16InterfaceAddress_4__hash__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_hash_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "netif.pyx":517
 * 
 *     def __hash__(self):
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_af); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dest_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_7 = PyObject_Hash(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_FromHash_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "netif.pyx":516
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.InterfaceAddress.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":519
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         ret = {
 *             'type': self.af.name,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16InterfaceAddress_7__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16InterfaceAddress_7__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_5netif_16InterfaceAddress_7__getstate__, METH_O, 0};
static PyObject *__pyx_pw_5netif_16InterfaceAddress_7__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16InterfaceAddress_6__getstate__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16InterfaceAddress_6__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":521
 *     def __getstate__(self):
 *         ret = {
 *             'type': self.af.name,             # <<<<<<<<<<<<<<
 *             'address': self.address.address if type(self.address) is LinkAddress else str(self.address)
 *         }
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_3) < 0) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":522
 *         ret = {
 *             'type': self.af.name,
 *             'address': self.address.address if type(self.address) is LinkAddress else str(self.address)             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_LinkAddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_t_2)) == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if ((__pyx_t_5 != 0)) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_address, __pyx_t_3) < 0) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ret = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "netif.pyx":525
 *         }
 * 
 *         if self.netmask:             # <<<<<<<<<<<<<<
 *             # XXX yuck!
 *             ret['netmask'] = bin(int(self.netmask)).count('1')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "netif.pyx":527
 *         if self.netmask:
 *             # XXX yuck!
 *             ret['netmask'] = bin(int(self.netmask)).count('1')             # <<<<<<<<<<<<<<
 * 
 *         if self.broadcast:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_bin, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_ret, __pyx_n_s_netmask, __pyx_t_3) < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":525
 *         }
 * 
 *         if self.netmask:             # <<<<<<<<<<<<<<
 *             # XXX yuck!
 *             ret['netmask'] = bin(int(self.netmask)).count('1')
 */
  }

  /* "netif.pyx":529
 *             ret['netmask'] = bin(int(self.netmask)).count('1')
 * 
 *         if self.broadcast:             # <<<<<<<<<<<<<<
 *             ret['broadcast'] = str(self.broadcast)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "netif.pyx":530
 * 
 *         if self.broadcast:
 *             ret['broadcast'] = str(self.broadcast)             # <<<<<<<<<<<<<<
 * 
 *         return ret
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_ret, __pyx_n_s_broadcast, __pyx_t_3) < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":529
 *             ret['netmask'] = bin(int(self.netmask)).count('1')
 * 
 *         if self.broadcast:             # <<<<<<<<<<<<<<
 *             ret['broadcast'] = str(self.broadcast)
 * 
 */
  }

  /* "netif.pyx":532
 *             ret['broadcast'] = str(self.broadcast)
 * 
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "netif.pyx":519
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         ret = {
 *             'type': self.af.name,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.InterfaceAddress.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":534
 *         return ret
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.af == other.af and \
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16InterfaceAddress_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16InterfaceAddress_9__eq__ = {"__eq__", (PyCFunction)__pyx_pw_5netif_16InterfaceAddress_9__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_16InterfaceAddress_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 534, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 534, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 534, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.InterfaceAddress.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_16InterfaceAddress_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16InterfaceAddress_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "netif.pyx":535
 * 
 *     def __eq__(self, other):
 *         return \             # <<<<<<<<<<<<<<
 *             self.af == other.af and \
 *             self.address == other.address and \
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":536
 *     def __eq__(self, other):
 *         return \
 *             self.af == other.af and \             # <<<<<<<<<<<<<<
 *             self.address == other.address and \
 *             self.netmask == other.netmask and \
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_af); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 536, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "netif.pyx":537
 *         return \
 *             self.af == other.af and \
 *             self.address == other.address and \             # <<<<<<<<<<<<<<
 *             self.netmask == other.netmask and \
 *             self.broadcast == other.broadcast and \
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 537, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "netif.pyx":538
 *             self.af == other.af and \
 *             self.address == other.address and \
 *             self.netmask == other.netmask and \             # <<<<<<<<<<<<<<
 *             self.broadcast == other.broadcast and \
 *             self.dest_address == other.dest_address and \
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_netmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 538, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "netif.pyx":539
 *             self.address == other.address and \
 *             self.netmask == other.netmask and \
 *             self.broadcast == other.broadcast and \             # <<<<<<<<<<<<<<
 *             self.dest_address == other.dest_address and \
 *             self.vhid == other.vhid
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 539, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "netif.pyx":540
 *             self.netmask == other.netmask and \
 *             self.broadcast == other.broadcast and \
 *             self.dest_address == other.dest_address and \             # <<<<<<<<<<<<<<
 *             self.vhid == other.vhid
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dest_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dest_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "netif.pyx":541
 *             self.broadcast == other.broadcast and \
 *             self.dest_address == other.dest_address and \
 *             self.vhid == other.vhid             # <<<<<<<<<<<<<<
 * 
 *     def __ne__(self, other):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vhid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_vhid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":534
 *         return ret
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.af == other.af and \
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.InterfaceAddress.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":543
 *             self.vhid == other.vhid
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16InterfaceAddress_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16InterfaceAddress_11__ne__ = {"__ne__", (PyCFunction)__pyx_pw_5netif_16InterfaceAddress_11__ne__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_16InterfaceAddress_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 543, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 543, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 543, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.InterfaceAddress.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_16InterfaceAddress_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16InterfaceAddress_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "netif.pyx":544
 * 
 *     def __ne__(self, other):
 *         return not self == other             # <<<<<<<<<<<<<<
 * 
 * # wrap socket.socket on python2 so that we can use "with"
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":543
 *             self.vhid == other.vhid
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.InterfaceAddress.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":549
 * if not hasattr(socket.socket, '__enter__'):
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):             # <<<<<<<<<<<<<<
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_10WrapSocket_1__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_10WrapSocket_1__enter__ = {"__enter__", (PyCFunction)__pyx_pw_5netif_10WrapSocket_1__enter__, METH_O, 0};
static PyObject *__pyx_pw_5netif_10WrapSocket_1__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_10WrapSocket___enter__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_10WrapSocket___enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "netif.pyx":550
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):
 *             return self             # <<<<<<<<<<<<<<
 *         def __exit__(self, exc_type, exc_val, exc_frame):
 *             self.close()
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "netif.pyx":549
 * if not hasattr(socket.socket, '__enter__'):
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):             # <<<<<<<<<<<<<<
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":551
 *         def __enter__(self):
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_10WrapSocket_3__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_10WrapSocket_3__exit__ = {"__exit__", (PyCFunction)__pyx_pw_5netif_10WrapSocket_3__exit__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_10WrapSocket_3__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_frame = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_frame,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 551, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 551, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_frame)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 551, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 551, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_exc_type = values[1];
    __pyx_v_exc_val = values[2];
    __pyx_v_exc_frame = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 551, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.WrapSocket.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_10WrapSocket_2__exit__(__pyx_self, __pyx_v_self, __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_frame);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_10WrapSocket_2__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_frame) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "netif.pyx":552
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     sock3 = WrapSocket
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":551
 *         def __enter__(self):
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.WrapSocket.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":564
 *     cdef readonly object addresses
 * 
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.nameb = name.encode('ascii')
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 564, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 564, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.NetworkInterface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_16NetworkInterface___init__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface___init__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":565
 * 
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.nameb = name.encode('ascii')
 *         self.addresses = []
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "netif.pyx":566
 *     def __init__(self, name):
 *         self.name = name
 *         self.nameb = name.encode('ascii')             # <<<<<<<<<<<<<<
 *         self.addresses = []
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->nameb);
  __Pyx_DECREF(__pyx_v_self->nameb);
  __pyx_v_self->nameb = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "netif.pyx":567
 *         self.name = name
 *         self.nameb = name.encode('ascii')
 *         self.addresses = []             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->addresses);
  __Pyx_DECREF(__pyx_v_self->addresses);
  __pyx_v_self->addresses = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "netif.pyx":564
 *     cdef readonly object addresses
 * 
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.nameb = name.encode('ascii')
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.NetworkInterface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":569
 *         self.addresses = []
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<netif.{0} name '{1}' type '{2}'>".format(self.__class__.__name__, self.name, self.type.name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_3__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_2__str__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_2__str__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "netif.pyx":570
 * 
 *     def __str__(self):
 *         return "<netif.{0} name '{1}' type '{2}'>".format(self.__class__.__name__, self.name, self.type.name)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_netif_0_name_1_type_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->type, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":569
 *         self.addresses = []
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<netif.{0} name '{1}' type '{2}'>".format(self.__class__.__name__, self.name, self.type.name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":572
 *         return "<netif.{0} name '{1}' type '{2}'>".format(self.__class__.__name__, self.name, self.type.name)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_4__repr__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_4__repr__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "netif.pyx":573
 * 
 *     def __repr__(self):
 *         return str(self)             # <<<<<<<<<<<<<<
 * 
 *     cdef int query_media(self, defs.ifmediareq* ifm):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "netif.pyx":572
 *         return "<netif.{0} name '{1}' type '{2}'>".format(self.__class__.__name__, self.name, self.type.name)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.NetworkInterface.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":575
 *         return str(self)
 * 
 *     cdef int query_media(self, defs.ifmediareq* ifm):             # <<<<<<<<<<<<<<
 *         memset(ifm, 0, cython.sizeof(defs.ifmediareq))
 *         strcpy(ifm.ifm_name, self.nameb)
 */

static int __pyx_f_5netif_16NetworkInterface_query_media(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, struct ifmediareq *__pyx_v_ifm) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("query_media", 0);

  /* "netif.pyx":576
 * 
 *     cdef int query_media(self, defs.ifmediareq* ifm):
 *         memset(ifm, 0, cython.sizeof(defs.ifmediareq))             # <<<<<<<<<<<<<<
 *         strcpy(ifm.ifm_name, self.nameb)
 *         if self.ioctl(defs.SIOCGIFMEDIA, <void*>ifm) == -1:
 */
  memset(__pyx_v_ifm, 0, (sizeof(struct ifmediareq)));

  /* "netif.pyx":577
 *     cdef int query_media(self, defs.ifmediareq* ifm):
 *         memset(ifm, 0, cython.sizeof(defs.ifmediareq))
 *         strcpy(ifm.ifm_name, self.nameb)             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCGIFMEDIA, <void*>ifm) == -1:
 *             return False
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
  strcpy(__pyx_v_ifm->ifm_name, __pyx_t_1);

  /* "netif.pyx":578
 *         memset(ifm, 0, cython.sizeof(defs.ifmediareq))
 *         strcpy(ifm.ifm_name, self.nameb)
 *         if self.ioctl(defs.SIOCGIFMEDIA, <void*>ifm) == -1:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFMEDIA, ((void *)__pyx_v_ifm), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":579
 *         strcpy(ifm.ifm_name, self.nameb)
 *         if self.ioctl(defs.SIOCGIFMEDIA, <void*>ifm) == -1:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "netif.pyx":578
 *         memset(ifm, 0, cython.sizeof(defs.ifmediareq))
 *         strcpy(ifm.ifm_name, self.nameb)
 *         if self.ioctl(defs.SIOCGIFMEDIA, <void*>ifm) == -1:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "netif.pyx":581
 *             return False
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "netif.pyx":575
 *         return str(self)
 * 
 *     cdef int query_media(self, defs.ifmediareq* ifm):             # <<<<<<<<<<<<<<
 *         memset(ifm, 0, cython.sizeof(defs.ifmediareq))
 *         strcpy(ifm.ifm_name, self.nameb)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("netif.NetworkInterface.query_media", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":583
 *         return True
 * 
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:
 */

static int __pyx_f_5netif_16NetworkInterface_ioctl(CYTHON_UNUSED struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, uint32_t __pyx_v_cmd, void *__pyx_v_args, struct __pyx_opt_args_5netif_16NetworkInterface_ioctl *__pyx_optional_args) {
  PyObject *__pyx_v_af = __pyx_k__3;
  int __pyx_v_result;
  PyObject *__pyx_v_s = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("ioctl", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_af = __pyx_optional_args->af;
    }
  }

  /* "netif.pyx":585
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *             result = defs.ioctl(s.fileno(), cmd, args)
 *         return result
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sock3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SOCK_DGRAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_af);
    __Pyx_GIVEREF(__pyx_v_af);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_af);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_s = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "netif.pyx":586
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:
 *             result = defs.ioctl(s.fileno(), cmd, args)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (__pyx_t_2) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          } else {
            __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_result = ioctl(__pyx_t_11, __pyx_v_cmd, __pyx_v_args);

          /* "netif.pyx":585
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *             result = defs.ioctl(s.fileno(), cmd, args)
 *         return result
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("netif.NetworkInterface.ioctl", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 585, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 585, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_13 < 0) __PYX_ERR(0, 585, __pyx_L9_except_error)
          __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0);
          if (__pyx_t_14) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_2);
            __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 585, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 585, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "netif.pyx":587
 *         with sock3(af, socket.SOCK_DGRAM) as s:
 *             result = defs.ioctl(s.fileno(), cmd, args)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef aliasreq(self, address, uint32_t cmd):
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":583
 *         return True
 * 
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("netif.NetworkInterface.ioctl", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":589
 *         return result
 * 
 *     cdef aliasreq(self, address, uint32_t cmd):             # <<<<<<<<<<<<<<
 *         cdef defs.sockaddr_in *sin
 *         cdef defs.sockaddr_in6 *sin6
 */

static PyObject *__pyx_f_5netif_16NetworkInterface_aliasreq(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_address, uint32_t __pyx_v_cmd) {
  struct sockaddr_in *__pyx_v_sin;
  struct sockaddr_in6 *__pyx_v_sin6;
  struct ifaliasreq __pyx_v_req;
  struct in6_aliasreq __pyx_v_req6;
  PyObject *__pyx_v_packed = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char const *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  uint32_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  char *__pyx_t_11;
  struct __pyx_opt_args_5netif_16NetworkInterface_ioctl __pyx_t_12;
  __Pyx_RefNannySetupContext("aliasreq", 0);

  /* "netif.pyx":595
 *         cdef defs.in6_aliasreq req6
 * 
 *         if address.af == AddressFamily.INET:             # <<<<<<<<<<<<<<
 *             memset(&req, 0, cython.sizeof(req))
 *             strcpy(req.ifra_name, self.nameb)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_af); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":596
 * 
 *         if address.af == AddressFamily.INET:
 *             memset(&req, 0, cython.sizeof(req))             # <<<<<<<<<<<<<<
 *             strcpy(req.ifra_name, self.nameb)
 * 
 */
    memset((&__pyx_v_req), 0, (sizeof(__pyx_v_req)));

    /* "netif.pyx":597
 *         if address.af == AddressFamily.INET:
 *             memset(&req, 0, cython.sizeof(req))
 *             strcpy(req.ifra_name, self.nameb)             # <<<<<<<<<<<<<<
 * 
 *             # Address
 */
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error)
    strcpy(__pyx_v_req.ifra_name, __pyx_t_5);

    /* "netif.pyx":600
 * 
 *             # Address
 *             sin = <defs.sockaddr_in*>&req.ifra_addr             # <<<<<<<<<<<<<<
 *             sin.sin_family = defs.AF_INET
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)
 */
    __pyx_v_sin = ((struct sockaddr_in *)(&__pyx_v_req.ifra_addr));

    /* "netif.pyx":601
 *             # Address
 *             sin = <defs.sockaddr_in*>&req.ifra_addr
 *             sin.sin_family = defs.AF_INET             # <<<<<<<<<<<<<<
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *             sin.sin_addr.s_addr = socket.ntohl(int(address.address))
 */
    __pyx_v_sin->sin_family = AF_INET;

    /* "netif.pyx":602
 *             sin = <defs.sockaddr_in*>&req.ifra_addr
 *             sin.sin_family = defs.AF_INET
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)             # <<<<<<<<<<<<<<
 *             sin.sin_addr.s_addr = socket.ntohl(int(address.address))
 * 
 */
    __pyx_v_sin->sin_len = (sizeof(struct sockaddr_in));

    /* "netif.pyx":603
 *             sin.sin_family = defs.AF_INET
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *             sin.sin_addr.s_addr = socket.ntohl(int(address.address))             # <<<<<<<<<<<<<<
 * 
 *             # Netmask
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_sin->sin_addr.s_addr = __pyx_t_8;

    /* "netif.pyx":606
 * 
 *             # Netmask
 *             sin = <defs.sockaddr_in*>&req.ifra_mask             # <<<<<<<<<<<<<<
 *             sin.sin_family = defs.AF_INET
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)
 */
    __pyx_v_sin = ((struct sockaddr_in *)(&__pyx_v_req.ifra_mask));

    /* "netif.pyx":607
 *             # Netmask
 *             sin = <defs.sockaddr_in*>&req.ifra_mask
 *             sin.sin_family = defs.AF_INET             # <<<<<<<<<<<<<<
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *             sin.sin_addr.s_addr = socket.ntohl(int(address.netmask))
 */
    __pyx_v_sin->sin_family = AF_INET;

    /* "netif.pyx":608
 *             sin = <defs.sockaddr_in*>&req.ifra_mask
 *             sin.sin_family = defs.AF_INET
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)             # <<<<<<<<<<<<<<
 *             sin.sin_addr.s_addr = socket.ntohl(int(address.netmask))
 * 
 */
    __pyx_v_sin->sin_len = (sizeof(struct sockaddr_in));

    /* "netif.pyx":609
 *             sin.sin_family = defs.AF_INET
 *             sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *             sin.sin_addr.s_addr = socket.ntohl(int(address.netmask))             # <<<<<<<<<<<<<<
 * 
 *             # Broadcast
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_sin->sin_addr.s_addr = __pyx_t_8;

    /* "netif.pyx":612
 * 
 *             # Broadcast
 *             if address.broadcast:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>&req.ifra_broadaddr
 *                 sin.sin_family = defs.AF_INET
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "netif.pyx":613
 *             # Broadcast
 *             if address.broadcast:
 *                 sin = <defs.sockaddr_in*>&req.ifra_broadaddr             # <<<<<<<<<<<<<<
 *                 sin.sin_family = defs.AF_INET
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 */
      __pyx_v_sin = ((struct sockaddr_in *)(&__pyx_v_req.ifra_broadaddr));

      /* "netif.pyx":614
 *             if address.broadcast:
 *                 sin = <defs.sockaddr_in*>&req.ifra_broadaddr
 *                 sin.sin_family = defs.AF_INET             # <<<<<<<<<<<<<<
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *                 sin.sin_addr.s_addr = socket.ntohl(int(address.broadcast))
 */
      __pyx_v_sin->sin_family = AF_INET;

      /* "netif.pyx":615
 *                 sin = <defs.sockaddr_in*>&req.ifra_broadaddr
 *                 sin.sin_family = defs.AF_INET
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)             # <<<<<<<<<<<<<<
 *                 sin.sin_addr.s_addr = socket.ntohl(int(address.broadcast))
 * 
 */
      __pyx_v_sin->sin_len = (sizeof(struct sockaddr_in));

      /* "netif.pyx":616
 *                 sin.sin_family = defs.AF_INET
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *                 sin.sin_addr.s_addr = socket.ntohl(int(address.broadcast))             # <<<<<<<<<<<<<<
 * 
 *             if address.vhid:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_broadcast); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_sin->sin_addr.s_addr = __pyx_t_8;

      /* "netif.pyx":612
 * 
 *             # Broadcast
 *             if address.broadcast:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>&req.ifra_broadaddr
 *                 sin.sin_family = defs.AF_INET
 */
    }

    /* "netif.pyx":618
 *                 sin.sin_addr.s_addr = socket.ntohl(int(address.broadcast))
 * 
 *             if address.vhid:             # <<<<<<<<<<<<<<
 *                 req.ifra_vhid = address.vhid
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_vhid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "netif.pyx":619
 * 
 *             if address.vhid:
 *                 req.ifra_vhid = address.vhid             # <<<<<<<<<<<<<<
 * 
 *             if self.ioctl(cmd, <void*>&req) == -1:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_vhid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_req.ifra_vhid = __pyx_t_9;

      /* "netif.pyx":618
 *                 sin.sin_addr.s_addr = socket.ntohl(int(address.broadcast))
 * 
 *             if address.vhid:             # <<<<<<<<<<<<<<
 *                 req.ifra_vhid = address.vhid
 * 
 */
    }

    /* "netif.pyx":621
 *                 req.ifra_vhid = address.vhid
 * 
 *             if self.ioctl(cmd, <void*>&req) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
    __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, __pyx_v_cmd, ((void *)(&__pyx_v_req)), NULL) == -1L) != 0);
    if (__pyx_t_4) {

      /* "netif.pyx":622
 * 
 *             if self.ioctl(cmd, <void*>&req) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *         elif address.af == AddressFamily.INET6:
 */
      __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 622, __pyx_L1_error)

      /* "netif.pyx":621
 *                 req.ifra_vhid = address.vhid
 * 
 *             if self.ioctl(cmd, <void*>&req) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
    }

    /* "netif.pyx":595
 *         cdef defs.in6_aliasreq req6
 * 
 *         if address.af == AddressFamily.INET:             # <<<<<<<<<<<<<<
 *             memset(&req, 0, cython.sizeof(req))
 *             strcpy(req.ifra_name, self.nameb)
 */
    goto __pyx_L3;
  }

  /* "netif.pyx":624
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *         elif address.af == AddressFamily.INET6:             # <<<<<<<<<<<<<<
 *             memset(&req6, 0, cython.sizeof(req6))
 *             strcpy(req6.ifra_name, self.nameb)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_af); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_INET6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":625
 * 
 *         elif address.af == AddressFamily.INET6:
 *             memset(&req6, 0, cython.sizeof(req6))             # <<<<<<<<<<<<<<
 *             strcpy(req6.ifra_name, self.nameb)
 *             req6.ifra_lifetime.ia6t_vltime = defs.ND6_INFINITE_LIFETIME
 */
    memset((&__pyx_v_req6), 0, (sizeof(__pyx_v_req6)));

    /* "netif.pyx":626
 *         elif address.af == AddressFamily.INET6:
 *             memset(&req6, 0, cython.sizeof(req6))
 *             strcpy(req6.ifra_name, self.nameb)             # <<<<<<<<<<<<<<
 *             req6.ifra_lifetime.ia6t_vltime = defs.ND6_INFINITE_LIFETIME
 *             req6.ifra_lifetime.ia6t_pltime = defs.ND6_INFINITE_LIFETIME
 */
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L1_error)
    strcpy(__pyx_v_req6.ifra_name, __pyx_t_5);

    /* "netif.pyx":627
 *             memset(&req6, 0, cython.sizeof(req6))
 *             strcpy(req6.ifra_name, self.nameb)
 *             req6.ifra_lifetime.ia6t_vltime = defs.ND6_INFINITE_LIFETIME             # <<<<<<<<<<<<<<
 *             req6.ifra_lifetime.ia6t_pltime = defs.ND6_INFINITE_LIFETIME
 * 
 */
    __pyx_v_req6.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;

    /* "netif.pyx":628
 *             strcpy(req6.ifra_name, self.nameb)
 *             req6.ifra_lifetime.ia6t_vltime = defs.ND6_INFINITE_LIFETIME
 *             req6.ifra_lifetime.ia6t_pltime = defs.ND6_INFINITE_LIFETIME             # <<<<<<<<<<<<<<
 * 
 *             # Address
 */
    __pyx_v_req6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;

    /* "netif.pyx":631
 * 
 *             # Address
 *             packed = address.address.packed[:16]             # <<<<<<<<<<<<<<
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_addr
 *             sin6.sin6_family = defs.AF_INET6
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_address); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_packed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 16, NULL, NULL, &__pyx_slice__5, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_packed = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "netif.pyx":632
 *             # Address
 *             packed = address.address.packed[:16]
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_addr             # <<<<<<<<<<<<<<
 *             sin6.sin6_family = defs.AF_INET6
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 */
    __pyx_v_sin6 = ((struct sockaddr_in6 *)(&__pyx_v_req6.ifra_addr));

    /* "netif.pyx":633
 *             packed = address.address.packed[:16]
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_addr
 *             sin6.sin6_family = defs.AF_INET6             # <<<<<<<<<<<<<<
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)
 */
    __pyx_v_sin6->sin6_family = AF_INET6;

    /* "netif.pyx":634
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_addr
 *             sin6.sin6_family = defs.AF_INET6
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)             # <<<<<<<<<<<<<<
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)
 * 
 */
    __pyx_v_sin6->sin6_len = (sizeof(struct sockaddr_in6));

    /* "netif.pyx":635
 *             sin6.sin6_family = defs.AF_INET6
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)             # <<<<<<<<<<<<<<
 * 
 *             # Netmask
 */
    __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_packed); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L1_error)
    memcpy(__pyx_v_sin6->sin6_addr.s6_addr, ((void *)((char *)__pyx_t_11)), 16);

    /* "netif.pyx":638
 * 
 *             # Netmask
 *             packed = address.netmask.packed[:16]             # <<<<<<<<<<<<<<
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_prefixmask
 *             sin6.sin6_family = defs.AF_INET6
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_netmask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_packed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 16, NULL, NULL, &__pyx_slice__6, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_packed, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "netif.pyx":639
 *             # Netmask
 *             packed = address.netmask.packed[:16]
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_prefixmask             # <<<<<<<<<<<<<<
 *             sin6.sin6_family = defs.AF_INET6
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 */
    __pyx_v_sin6 = ((struct sockaddr_in6 *)(&__pyx_v_req6.ifra_prefixmask));

    /* "netif.pyx":640
 *             packed = address.netmask.packed[:16]
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_prefixmask
 *             sin6.sin6_family = defs.AF_INET6             # <<<<<<<<<<<<<<
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)
 */
    __pyx_v_sin6->sin6_family = AF_INET6;

    /* "netif.pyx":641
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_prefixmask
 *             sin6.sin6_family = defs.AF_INET6
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)             # <<<<<<<<<<<<<<
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)
 * 
 */
    __pyx_v_sin6->sin6_len = (sizeof(struct sockaddr_in6));

    /* "netif.pyx":642
 *             sin6.sin6_family = defs.AF_INET6
 *             sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)             # <<<<<<<<<<<<<<
 * 
 *             if address.vhid:
 */
    __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_packed); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L1_error)
    memcpy(__pyx_v_sin6->sin6_addr.s6_addr, ((void *)((char *)__pyx_t_11)), 16);

    /* "netif.pyx":644
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)
 * 
 *             if address.vhid:             # <<<<<<<<<<<<<<
 *                 req.ifra_vhid = address.vhid
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_vhid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "netif.pyx":645
 * 
 *             if address.vhid:
 *                 req.ifra_vhid = address.vhid             # <<<<<<<<<<<<<<
 * 
 *             if self.ioctl(cmd, <void*>&req6, socket.AF_INET6) == -1:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_vhid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_req.ifra_vhid = __pyx_t_9;

      /* "netif.pyx":644
 *             memcpy(sin6.sin6_addr.s6_addr, <void*><char*>packed, 16)
 * 
 *             if address.vhid:             # <<<<<<<<<<<<<<
 *                 req.ifra_vhid = address.vhid
 * 
 */
    }

    /* "netif.pyx":647
 *                 req.ifra_vhid = address.vhid
 * 
 *             if self.ioctl(cmd, <void*>&req6, socket.AF_INET6) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_AF_INET6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.af = __pyx_t_2;
    __pyx_t_9 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, __pyx_v_cmd, ((void *)(&__pyx_v_req6)), &__pyx_t_12); 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = ((__pyx_t_9 == -1L) != 0);
    if (__pyx_t_4) {

      /* "netif.pyx":648
 * 
 *             if self.ioctl(cmd, <void*>&req6, socket.AF_INET6) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
      __pyx_t_2 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(0, 648, __pyx_L1_error)

      /* "netif.pyx":647
 *                 req.ifra_vhid = address.vhid
 * 
 *             if self.ioctl(cmd, <void*>&req6, socket.AF_INET6) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
    }

    /* "netif.pyx":624
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *         elif address.af == AddressFamily.INET6:             # <<<<<<<<<<<<<<
 *             memset(&req6, 0, cython.sizeof(req6))
 *             strcpy(req6.ifra_name, self.nameb)
 */
    goto __pyx_L3;
  }

  /* "netif.pyx":651
 * 
 *         else:
 *             raise NotImplementedError()             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 651, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "netif.pyx":589
 *         return result
 * 
 *     cdef aliasreq(self, address, uint32_t cmd):             # <<<<<<<<<<<<<<
 *         cdef defs.sockaddr_in *sin
 *         cdef defs.sockaddr_in6 *sin6
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("netif.NetworkInterface.aliasreq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_packed);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":653
 *             raise NotImplementedError()
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'name': self.name,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_6__getstate__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_6__getstate__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":654
 * 
 *     def __getstate__(self):
 *         return {             # <<<<<<<<<<<<<<
 *             'name': self.name,
 *             'description': self.description,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":655
 *     def __getstate__(self):
 *         return {
 *             'name': self.name,             # <<<<<<<<<<<<<<
 *             'description': self.description,
 *             'mtu': self.mtu,
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(0, 655, __pyx_L1_error)

  /* "netif.pyx":656
 *         return {
 *             'name': self.name,
 *             'description': self.description,             # <<<<<<<<<<<<<<
 *             'mtu': self.mtu,
 *             'cloned': self.cloned,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_description, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":657
 *             'name': self.name,
 *             'description': self.description,
 *             'mtu': self.mtu,             # <<<<<<<<<<<<<<
 *             'cloned': self.cloned,
 *             'flags': [i.name for i in self.flags],
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mtu); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mtu, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":658
 *             'description': self.description,
 *             'mtu': self.mtu,
 *             'cloned': self.cloned,             # <<<<<<<<<<<<<<
 *             'flags': [i.name for i in self.flags],
 *             'nd6_flags': [i.name for i in self.nd6_flags],
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cloned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cloned, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":659
 *             'mtu': self.mtu,
 *             'cloned': self.cloned,
 *             'flags': [i.name for i in self.flags],             # <<<<<<<<<<<<<<
 *             'nd6_flags': [i.name for i in self.nd6_flags],
 *             'capabilities': [i.name for i in self.capabilities],
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 659, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":660
 *             'cloned': self.cloned,
 *             'flags': [i.name for i in self.flags],
 *             'nd6_flags': [i.name for i in self.nd6_flags],             # <<<<<<<<<<<<<<
 *             'capabilities': [i.name for i in self.capabilities],
 *             'link_state': self.link_state.name,
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nd6_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 660, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 660, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 660, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nd6_flags, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":661
 *             'flags': [i.name for i in self.flags],
 *             'nd6_flags': [i.name for i in self.nd6_flags],
 *             'capabilities': [i.name for i in self.capabilities],             # <<<<<<<<<<<<<<
 *             'link_state': self.link_state.name,
 *             'media_type': self.media_type,
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_capabilities); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 661, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_capabilities, __pyx_t_2) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":662
 *             'nd6_flags': [i.name for i in self.nd6_flags],
 *             'capabilities': [i.name for i in self.capabilities],
 *             'link_state': self.link_state.name,             # <<<<<<<<<<<<<<
 *             'media_type': self.media_type,
 *             'media_subtype': self.media_subtype,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_link_state, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":663
 *             'capabilities': [i.name for i in self.capabilities],
 *             'link_state': self.link_state.name,
 *             'media_type': self.media_type,             # <<<<<<<<<<<<<<
 *             'media_subtype': self.media_subtype,
 *             'active_media_type': self.active_media_type,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_media_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_media_type, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":664
 *             'link_state': self.link_state.name,
 *             'media_type': self.media_type,
 *             'media_subtype': self.media_subtype,             # <<<<<<<<<<<<<<
 *             'active_media_type': self.active_media_type,
 *             'active_media_subtype': self.active_media_subtype,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_media_subtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_media_subtype, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":665
 *             'media_type': self.media_type,
 *             'media_subtype': self.media_subtype,
 *             'active_media_type': self.active_media_type,             # <<<<<<<<<<<<<<
 *             'active_media_subtype': self.active_media_subtype,
 *             'media_options': [i.name for i in self.media_options] if self.media_options is not None else None,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active_media_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_active_media_type, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":666
 *             'media_subtype': self.media_subtype,
 *             'active_media_type': self.active_media_type,
 *             'active_media_subtype': self.active_media_subtype,             # <<<<<<<<<<<<<<
 *             'media_options': [i.name for i in self.media_options] if self.media_options is not None else None,
 *             'link_address': self.link_address.address.address,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active_media_subtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_active_media_subtype, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":667
 *             'active_media_type': self.active_media_type,
 *             'active_media_subtype': self.active_media_subtype,
 *             'media_options': [i.name for i in self.media_options] if self.media_options is not None else None,             # <<<<<<<<<<<<<<
 *             'link_address': self.link_address.address.address,
 *             'aliases': [i.__getstate__() for i in self.addresses]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_media_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((__pyx_t_7 != 0)) {
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_media_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_8);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 667, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 667, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_4 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_4 = Py_None;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_media_options, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":668
 *             'active_media_subtype': self.active_media_subtype,
 *             'media_options': [i.name for i in self.media_options] if self.media_options is not None else None,
 *             'link_address': self.link_address.address.address,             # <<<<<<<<<<<<<<
 *             'aliases': [i.__getstate__() for i in self.addresses]
 *         }
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_link_address, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":669
 *             'media_options': [i.name for i in self.media_options] if self.media_options is not None else None,
 *             'link_address': self.link_address.address.address,
 *             'aliases': [i.__getstate__() for i in self.addresses]             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_v_self->addresses)) || PyTuple_CheckExact(__pyx_v_self->addresses)) {
    __pyx_t_2 = __pyx_v_self->addresses; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->addresses); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 669, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_getstate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_9) {
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aliases, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":653
 *             raise NotImplementedError()
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'name': self.name,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.NetworkInterface.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":672
 *         }
 * 
 *     cdef uint32_t __get_flags(self) except? -1:             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 */

static uint32_t __pyx_f_5netif_16NetworkInterface___get_flags(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get_flags", 0);

  /* "netif.pyx":674
 *     cdef uint32_t __get_flags(self) except? -1:
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 * 
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":675
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCGIFFLAGS, <void*>&ifr) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":677
 *         strcpy(ifr.ifr_name, self.nameb)
 * 
 *         if self.ioctl(defs.SIOCGIFFLAGS, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFFLAGS, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":678
 * 
 *         if self.ioctl(defs.SIOCGIFFLAGS, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *         return ifr.ifr_ifru.ifru_flags[0]
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 678, __pyx_L1_error)

    /* "netif.pyx":677
 *         strcpy(ifr.ifr_name, self.nameb)
 * 
 *         if self.ioctl(defs.SIOCGIFFLAGS, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":680
 *             raise OSError(errno, os.strerror(errno))
 * 
 *         return ifr.ifr_ifru.ifru_flags[0]             # <<<<<<<<<<<<<<
 * 
 *     cdef uint32_t __rw_nd6_flags(self, value=None) except? -1:
 */
  __pyx_r = (__pyx_v_ifr.ifr_ifru.ifru_flags[0]);
  goto __pyx_L0;

  /* "netif.pyx":672
 *         }
 * 
 *     cdef uint32_t __get_flags(self) except? -1:             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.__get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":682
 *         return ifr.ifr_ifru.ifru_flags[0]
 * 
 *     cdef uint32_t __rw_nd6_flags(self, value=None) except? -1:             # <<<<<<<<<<<<<<
 *         cdef defs.in6_ndireq nd;
 *         memset(&nd, 0, cython.sizeof(nd))
 */

static uint32_t __pyx_f_5netif_16NetworkInterface___rw_nd6_flags(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags *__pyx_optional_args) {
  PyObject *__pyx_v_value = ((PyObject *)Py_None);
  struct in6_ndireq __pyx_v_nd;
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_5netif_16NetworkInterface_ioctl __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  uint32_t __pyx_t_12;
  __Pyx_RefNannySetupContext("__rw_nd6_flags", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_value = __pyx_optional_args->value;
    }
  }

  /* "netif.pyx":684
 *     cdef uint32_t __rw_nd6_flags(self, value=None) except? -1:
 *         cdef defs.in6_ndireq nd;
 *         memset(&nd, 0, cython.sizeof(nd))             # <<<<<<<<<<<<<<
 *         strcpy(nd.ifname, self.nameb)
 * 
 */
  memset((&__pyx_v_nd), 0, (sizeof(__pyx_v_nd)));

  /* "netif.pyx":685
 *         cdef defs.in6_ndireq nd;
 *         memset(&nd, 0, cython.sizeof(nd))
 *         strcpy(nd.ifname, self.nameb)             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCGIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 685, __pyx_L1_error)
  strcpy(__pyx_v_nd.ifname, __pyx_t_1);

  /* "netif.pyx":687
 *         strcpy(nd.ifname, self.nameb)
 * 
 *         if self.ioctl(defs.SIOCGIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INET6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.af = __pyx_t_3;
  __pyx_t_4 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFINFO_IN6, ((void *)(&__pyx_v_nd)), &__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = ((__pyx_t_4 == -1L) != 0);
  if (__pyx_t_6) {

    /* "netif.pyx":688
 * 
 *         if self.ioctl(defs.SIOCGIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *         if value is None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_strerror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 688, __pyx_L1_error)

    /* "netif.pyx":687
 *         strcpy(nd.ifname, self.nameb)
 * 
 *         if self.ioctl(defs.SIOCGIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":690
 *             raise OSError(errno, os.strerror(errno))
 * 
 *         if value is None:             # <<<<<<<<<<<<<<
 *             return nd.ndi.flags
 * 
 */
  __pyx_t_6 = (__pyx_v_value == Py_None);
  __pyx_t_11 = (__pyx_t_6 != 0);
  if (__pyx_t_11) {

    /* "netif.pyx":691
 * 
 *         if value is None:
 *             return nd.ndi.flags             # <<<<<<<<<<<<<<
 * 
 *         nd.ndi.flags = value
 */
    __pyx_r = __pyx_v_nd.ndi.flags;
    goto __pyx_L0;

    /* "netif.pyx":690
 *             raise OSError(errno, os.strerror(errno))
 * 
 *         if value is None:             # <<<<<<<<<<<<<<
 *             return nd.ndi.flags
 * 
 */
  }

  /* "netif.pyx":693
 *             return nd.ndi.flags
 * 
 *         nd.ndi.flags = value             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_12 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L1_error)
  __pyx_v_nd.ndi.flags = __pyx_t_12;

  /* "netif.pyx":694
 * 
 *         nd.ndi.flags = value
 *         if self.ioctl(defs.SIOCSIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INET6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.af = __pyx_t_8;
  __pyx_t_4 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFINFO_IN6, ((void *)(&__pyx_v_nd)), &__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_11 = ((__pyx_t_4 == -1L) != 0);
  if (__pyx_t_11) {

    /* "netif.pyx":695
 *         nd.ndi.flags = value
 *         if self.ioctl(defs.SIOCSIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property cloned:
 */
    __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
    __pyx_t_8 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 695, __pyx_L1_error)

    /* "netif.pyx":694
 * 
 *         nd.ndi.flags = value
 *         if self.ioctl(defs.SIOCSIFINFO_IN6, <void*>&nd, af=AddressFamily.INET6) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":682
 *         return ifr.ifr_ifru.ifru_flags[0]
 * 
 *     cdef uint32_t __rw_nd6_flags(self, value=None) except? -1:             # <<<<<<<<<<<<<<
 *         cdef defs.in6_ndireq nd;
 *         memset(&nd, 0, cython.sizeof(nd))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("netif.NetworkInterface.__rw_nd6_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":698
 * 
 *     property cloned:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             for i in CLONED_PREFIXES:
 *                 if self.name.startswith(i):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_6cloned_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_6cloned_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_6cloned___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_6cloned___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":699
 *     property cloned:
 *         def __get__(self):
 *             for i in CLONED_PREFIXES:             # <<<<<<<<<<<<<<
 *                 if self.name.startswith(i):
 *                     return True
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CLONED_PREFIXES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 699, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 699, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 699, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "netif.pyx":700
 *         def __get__(self):
 *             for i in CLONED_PREFIXES:
 *                 if self.name.startswith(i):             # <<<<<<<<<<<<<<
 *                     return True
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_i);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 700, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "netif.pyx":701
 *             for i in CLONED_PREFIXES:
 *                 if self.name.startswith(i):
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *             return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "netif.pyx":700
 *         def __get__(self):
 *             for i in CLONED_PREFIXES:
 *                 if self.name.startswith(i):             # <<<<<<<<<<<<<<
 *                     return True
 * 
 */
    }

    /* "netif.pyx":699
 *     property cloned:
 *         def __get__(self):
 *             for i in CLONED_PREFIXES:             # <<<<<<<<<<<<<<
 *                 if self.name.startswith(i):
 *                     return True
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":703
 *                     return True
 * 
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     property flags:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "netif.pyx":698
 * 
 *     property cloned:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             for i in CLONED_PREFIXES:
 *                 if self.name.startswith(i):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.cloned.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":706
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.__get_flags(), InterfaceFlags)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_5flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_5flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_5flags___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_5flags___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  uint32_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":707
 *     property flags:
 *         def __get__(self):
 *             return bitmask_to_set(self.__get_flags(), InterfaceFlags)             # <<<<<<<<<<<<<<
 * 
 *     property nd6_flags:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->__pyx___get_flags(__pyx_v_self); if (unlikely(__pyx_t_3 == -1 && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceFlags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":706
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.__get_flags(), InterfaceFlags)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":710
 * 
 *     property nd6_flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.__rw_nd6_flags(), NeighborDiscoveryFlags)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_9nd6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_9nd6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_9nd6_flags___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_9nd6_flags___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  uint32_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":711
 *     property nd6_flags:
 *         def __get__(self):
 *             return bitmask_to_set(self.__rw_nd6_flags(), NeighborDiscoveryFlags)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, flags):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->__pyx___rw_nd6_flags(__pyx_v_self, NULL); if (unlikely(__pyx_t_3 == -1 && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NeighborDiscoveryFlags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":710
 * 
 *     property nd6_flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.__rw_nd6_flags(), NeighborDiscoveryFlags)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.nd6_flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":713
 *             return bitmask_to_set(self.__rw_nd6_flags(), NeighborDiscoveryFlags)
 * 
 *         def __set__(self, flags):             # <<<<<<<<<<<<<<
 *             self.__rw_nd6_flags(set_to_bitmask(flags))
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_9nd6_flags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flags); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_9nd6_flags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_9nd6_flags_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_9nd6_flags_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  uint32_t __pyx_t_5;
  struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags __pyx_t_6;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":714
 * 
 *         def __set__(self, flags):
 *             self.__rw_nd6_flags(set_to_bitmask(flags))             # <<<<<<<<<<<<<<
 * 
 *     property mtu:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_to_bitmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_flags);
    __Pyx_GIVEREF(__pyx_v_flags);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_flags);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.value = __pyx_t_1;
  __pyx_t_5 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->__pyx___rw_nd6_flags(__pyx_v_self, &__pyx_t_6); if (unlikely(__pyx_t_5 == -1 && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":713
 *             return bitmask_to_set(self.__rw_nd6_flags(), NeighborDiscoveryFlags)
 * 
 *         def __set__(self, flags):             # <<<<<<<<<<<<<<
 *             self.__rw_nd6_flags(set_to_bitmask(flags))
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.NetworkInterface.nd6_flags.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":717
 * 
 *     property mtu:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_3mtu_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_3mtu_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_3mtu___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_3mtu___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":719
 *         def __get__(self):
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMTU, <void*>&ifr) == -1:
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":720
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCGIFMTU, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":721
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMTU, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 *             return ifr.ifr_ifru.ifru_mtu
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFMTU, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":722
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMTU, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 *             return ifr.ifr_ifru.ifru_mtu
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 722, __pyx_L1_error)

    /* "netif.pyx":721
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMTU, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 *             return ifr.ifr_ifru.ifru_mtu
 */
  }

  /* "netif.pyx":723
 *             if self.ioctl(defs.SIOCGIFMTU, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 *             return ifr.ifr_ifru.ifru_mtu             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, mtu):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ifr.ifr_ifru.ifru_mtu); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "netif.pyx":717
 * 
 *     property mtu:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.mtu.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":725
 *             return ifr.ifr_ifru.ifru_mtu
 * 
 *         def __set__(self, mtu):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_3mtu_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mtu); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_3mtu_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mtu) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_3mtu_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_mtu));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_3mtu_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_mtu) {
  struct ifreq __pyx_v_ifr;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":727
 *         def __set__(self, mtu):
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_mtu = mtu
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":728
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_mtu = mtu
 *             if self.ioctl(defs.SIOCSIFMTU, <void*>&ifr) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":729
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_mtu = mtu             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCSIFMTU, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_mtu); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error)
  __pyx_v_ifr.ifr_ifru.ifru_mtu = __pyx_t_2;

  /* "netif.pyx":730
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_mtu = mtu
 *             if self.ioctl(defs.SIOCSIFMTU, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_3 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFMTU, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":731
 *             ifr.ifr_ifru.ifru_mtu = mtu
 *             if self.ioctl(defs.SIOCSIFMTU, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property capabilities:
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 731, __pyx_L1_error)

    /* "netif.pyx":730
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_mtu = mtu
 *             if self.ioctl(defs.SIOCSIFMTU, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":725
 *             return ifr.ifr_ifru.ifru_mtu
 * 
 *         def __set__(self, mtu):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.NetworkInterface.mtu.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":734
 * 
 *     property capabilities:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_12capabilities_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_12capabilities_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_12capabilities___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_12capabilities___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":736
 *         def __get__(self):
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFCAP, <void*>&ifr) == -1:
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":737
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCGIFCAP, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":738
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFCAP, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFCAP, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":739
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFCAP, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             return bitmask_to_set(ifr.ifr_ifru.ifru_cap[1], InterfaceCapability)
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 739, __pyx_L1_error)

    /* "netif.pyx":738
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFCAP, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":741
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             return bitmask_to_set(ifr.ifr_ifru.ifru_cap[1], InterfaceCapability)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_ifr.ifr_ifru.ifru_cap[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceCapability); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_t_8);
  __pyx_t_3 = 0;
  __pyx_t_8 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "netif.pyx":734
 * 
 *     property capabilities:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.capabilities.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":743
 *             return bitmask_to_set(ifr.ifr_ifru.ifru_cap[1], InterfaceCapability)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_12capabilities_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_12capabilities_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_12capabilities_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_12capabilities_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value) {
  struct ifreq __pyx_v_ifr;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":745
 *         def __set__(self, value):
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_cap[0] = set_to_bitmask(value)
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":746
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_cap[0] = set_to_bitmask(value)
 *             if self.ioctl(defs.SIOCSIFCAP, <void*>&ifr) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":747
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_cap[0] = set_to_bitmask(value)             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCSIFCAP, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_to_bitmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_value);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  (__pyx_v_ifr.ifr_ifru.ifru_cap[0]) = __pyx_t_6;

  /* "netif.pyx":748
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_cap[0] = set_to_bitmask(value)
 *             if self.ioctl(defs.SIOCSIFCAP, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_7 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFCAP, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_7) {

    /* "netif.pyx":749
 *             ifr.ifr_ifru.ifru_cap[0] = set_to_bitmask(value)
 *             if self.ioctl(defs.SIOCSIFCAP, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property link_state:
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 749, __pyx_L1_error)

    /* "netif.pyx":748
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_cap[0] = set_to_bitmask(value)
 *             if self.ioctl(defs.SIOCSIFCAP, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":743
 *             return bitmask_to_set(ifr.ifr_ifru.ifru_cap[1], InterfaceCapability)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.NetworkInterface.capabilities.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":752
 * 
 *     property link_state:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             memset(&ifm, 0, cython.sizeof(ifm))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_10link_state_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_10link_state_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_10link_state___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_10link_state___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifmediareq __pyx_v_ifm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":754
 *         def __get__(self):
 *             cdef defs.ifmediareq ifm
 *             memset(&ifm, 0, cython.sizeof(ifm))             # <<<<<<<<<<<<<<
 *             strcpy(ifm.ifm_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:
 */
  memset((&__pyx_v_ifm), 0, (sizeof(__pyx_v_ifm)));

  /* "netif.pyx":755
 *             cdef defs.ifmediareq ifm
 *             memset(&ifm, 0, cython.sizeof(ifm))
 *             strcpy(ifm.ifm_name, self.nameb)             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:
 *                 if errno != 22: # Invalid argument
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
  strcpy(__pyx_v_ifm.ifm_name, __pyx_t_1);

  /* "netif.pyx":756
 *             memset(&ifm, 0, cython.sizeof(ifm))
 *             strcpy(ifm.ifm_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:             # <<<<<<<<<<<<<<
 *                 if errno != 22: # Invalid argument
 *                     raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFMEDIA, ((void *)(&__pyx_v_ifm)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":757
 *             strcpy(ifm.ifm_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:
 *                 if errno != 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     raise OSError(errno, os.strerror(errno))
 * 
 */
    __pyx_t_2 = ((errno != 22) != 0);
    if (__pyx_t_2) {

      /* "netif.pyx":758
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:
 *                 if errno != 22: # Invalid argument
 *                     raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             if ifm.ifm_status & defs.IFM_AVALID:
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 758, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 758, __pyx_L1_error)

      /* "netif.pyx":757
 *             strcpy(ifm.ifm_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:
 *                 if errno != 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     raise OSError(errno, os.strerror(errno))
 * 
 */
    }

    /* "netif.pyx":756
 *             memset(&ifm, 0, cython.sizeof(ifm))
 *             strcpy(ifm.ifm_name, self.nameb)
 *             if self.ioctl(defs.SIOCGIFMEDIA, <void*>&ifm) == -1:             # <<<<<<<<<<<<<<
 *                 if errno != 22: # Invalid argument
 *                     raise OSError(errno, os.strerror(errno))
 */
  }

  /* "netif.pyx":760
 *                     raise OSError(errno, os.strerror(errno))
 * 
 *             if ifm.ifm_status & defs.IFM_AVALID:             # <<<<<<<<<<<<<<
 *                 if ifm.ifm_status & defs.IFM_ACTIVE:
 *                     return InterfaceLinkState.LINK_STATE_UP
 */
  __pyx_t_2 = ((__pyx_v_ifm.ifm_status & IFM_AVALID) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":761
 * 
 *             if ifm.ifm_status & defs.IFM_AVALID:
 *                 if ifm.ifm_status & defs.IFM_ACTIVE:             # <<<<<<<<<<<<<<
 *                     return InterfaceLinkState.LINK_STATE_UP
 *                 else:
 */
    __pyx_t_2 = ((__pyx_v_ifm.ifm_status & IFM_ACTIVE) != 0);
    if (__pyx_t_2) {

      /* "netif.pyx":762
 *             if ifm.ifm_status & defs.IFM_AVALID:
 *                 if ifm.ifm_status & defs.IFM_ACTIVE:
 *                     return InterfaceLinkState.LINK_STATE_UP             # <<<<<<<<<<<<<<
 *                 else:
 *                     return InterfaceLinkState.LINK_STATE_DOWN
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceLinkState); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LINK_STATE_UP); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "netif.pyx":761
 * 
 *             if ifm.ifm_status & defs.IFM_AVALID:
 *                 if ifm.ifm_status & defs.IFM_ACTIVE:             # <<<<<<<<<<<<<<
 *                     return InterfaceLinkState.LINK_STATE_UP
 *                 else:
 */
    }

    /* "netif.pyx":764
 *                     return InterfaceLinkState.LINK_STATE_UP
 *                 else:
 *                     return InterfaceLinkState.LINK_STATE_DOWN             # <<<<<<<<<<<<<<
 *             else:
 *                 return InterfaceLinkState.LINK_STATE_UNKNOWN
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceLinkState); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_LINK_STATE_DOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "netif.pyx":760
 *                     raise OSError(errno, os.strerror(errno))
 * 
 *             if ifm.ifm_status & defs.IFM_AVALID:             # <<<<<<<<<<<<<<
 *                 if ifm.ifm_status & defs.IFM_ACTIVE:
 *                     return InterfaceLinkState.LINK_STATE_UP
 */
  }

  /* "netif.pyx":766
 *                     return InterfaceLinkState.LINK_STATE_DOWN
 *             else:
 *                 return InterfaceLinkState.LINK_STATE_UNKNOWN             # <<<<<<<<<<<<<<
 * 
 *     property link_address:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceLinkState); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LINK_STATE_UNKNOWN); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "netif.pyx":752
 * 
 *     property link_state:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             memset(&ifm, 0, cython.sizeof(ifm))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.link_state.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":769
 * 
 *     property link_address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_12link_address_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_12link_address_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_12link_address___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":770
 *     property link_address:
 *         def __get__(self):
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, address):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_12link_address_7__get___lambda(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5netif_16NetworkInterface_12link_address_7__get___lambda = {"lambda", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_12link_address_7__get___lambda, METH_O, 0};
static PyObject *__pyx_pw_5netif_16NetworkInterface_12link_address_7__get___lambda(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_x));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_af); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(AF_LINK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.NetworkInterface.link_address.__get__.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":769
 * 
 *     property link_address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()
 * 
 */

static PyObject *__pyx_pf_5netif_16NetworkInterface_12link_address___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":770
 *     property link_address:
 *         def __get__(self):
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, address):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16NetworkInterface_12link_address_7__get___lambda, 0, __pyx_n_s_NetworkInterface___get___locals, NULL, __pyx_n_s_netif, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->addresses);
  __Pyx_GIVEREF(__pyx_v_self->addresses);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->addresses);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyList_Pop(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":769
 * 
 *     property link_address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.NetworkInterface.link_address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":772
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()
 * 
 *         def __set__(self, address):             # <<<<<<<<<<<<<<
 *             raise NotImplementedError()
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_12link_address_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_address); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_12link_address_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_address) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_12link_address_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_address));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_12link_address_2__set__(CYTHON_UNUSED struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_address) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":773
 * 
 *         def __set__(self, address):
 *             raise NotImplementedError()             # <<<<<<<<<<<<<<
 * 
 *     property media_type:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 773, __pyx_L1_error)

  /* "netif.pyx":772
 *             return list(filter(lambda x: x.af == defs.AF_LINK, self.addresses)).pop()
 * 
 *         def __set__(self, address):             # <<<<<<<<<<<<<<
 *             raise NotImplementedError()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.NetworkInterface.link_address.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":776
 * 
 *     property media_type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_10media_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_10media_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_10media_type___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_10media_type___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifmediareq __pyx_v_ifm;
  struct ifmedia_description *__pyx_v_ifmt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char const *__pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":779
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":780
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    __pyx_t_1 = ((errno == 22) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":781
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument
 *                     return None             # <<<<<<<<<<<<<<
 * 
 *                 raise OSError(errno, os.strerror(errno))
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;

      /* "netif.pyx":780
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    }

    /* "netif.pyx":783
 *                     return None
 * 
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             ifmt = get_toptype_desc(ifm.ifm_current)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 783, __pyx_L1_error)

    /* "netif.pyx":779
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  }

  /* "netif.pyx":785
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             ifmt = get_toptype_desc(ifm.ifm_current)             # <<<<<<<<<<<<<<
 *             return ifmt.ifmt_string.decode('ascii')
 * 
 */
  __pyx_v_ifmt = get_toptype_desc(__pyx_v_ifm.ifm_current);

  /* "netif.pyx":786
 * 
 *             ifmt = get_toptype_desc(ifm.ifm_current)
 *             return ifmt.ifmt_string.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *     property active_media_type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_v_ifmt->ifmt_string;
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":776
 * 
 *     property media_type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.media_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":789
 * 
 *     property active_media_type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_17active_media_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_17active_media_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_17active_media_type___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_17active_media_type___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifmediareq __pyx_v_ifm;
  struct ifmedia_description *__pyx_v_ifmt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char const *__pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":792
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":793
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    __pyx_t_1 = ((errno == 22) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":794
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument
 *                     return None             # <<<<<<<<<<<<<<
 * 
 *                 raise OSError(errno, os.strerror(errno))
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;

      /* "netif.pyx":793
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    }

    /* "netif.pyx":796
 *                     return None
 * 
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             ifmt = get_toptype_desc(ifm.ifm_active)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 796, __pyx_L1_error)

    /* "netif.pyx":792
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  }

  /* "netif.pyx":798
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             ifmt = get_toptype_desc(ifm.ifm_active)             # <<<<<<<<<<<<<<
 *             return ifmt.ifmt_string.decode('ascii')
 * 
 */
  __pyx_v_ifmt = get_toptype_desc(__pyx_v_ifm.ifm_active);

  /* "netif.pyx":799
 * 
 *             ifmt = get_toptype_desc(ifm.ifm_active)
 *             return ifmt.ifmt_string.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *     property media_subtype:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_v_ifmt->ifmt_string;
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":789
 * 
 *     property active_media_type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.active_media_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":802
 * 
 *     property media_subtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_13media_subtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_13media_subtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_13media_subtype___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_13media_subtype___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifmediareq __pyx_v_ifm;
  struct ifmedia_description *__pyx_v_ifmt;
  struct ifmedia_type_to_subtype *__pyx_v_ttos;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char const *__pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":807
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":808
 * 
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    __pyx_t_1 = ((errno == 22) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":809
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument
 *                     return None             # <<<<<<<<<<<<<<
 * 
 *                 raise OSError(errno, os.strerror(errno))
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;

      /* "netif.pyx":808
 * 
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    }

    /* "netif.pyx":811
 *                     return None
 * 
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_current)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 811, __pyx_L1_error)

    /* "netif.pyx":807
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  }

  /* "netif.pyx":813
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_current)             # <<<<<<<<<<<<<<
 *             ifmt = get_subtype_desc(ifm.ifm_current, ttos)
 *             return ifmt.ifmt_string.decode('ascii')
 */
  __pyx_v_ttos = get_toptype_ttos(__pyx_v_ifm.ifm_current);

  /* "netif.pyx":814
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_current)
 *             ifmt = get_subtype_desc(ifm.ifm_current, ttos)             # <<<<<<<<<<<<<<
 *             return ifmt.ifmt_string.decode('ascii')
 * 
 */
  __pyx_v_ifmt = get_subtype_desc(__pyx_v_ifm.ifm_current, __pyx_v_ttos);

  /* "netif.pyx":815
 *             ttos = get_toptype_ttos(ifm.ifm_current)
 *             ifmt = get_subtype_desc(ifm.ifm_current, ttos)
 *             return ifmt.ifmt_string.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_v_ifmt->ifmt_string;
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":802
 * 
 *     property media_subtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.media_subtype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":817
 *             return ifmt.ifmt_string.decode('ascii')
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.ifmediareq ifm
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_13media_subtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_13media_subtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_13media_subtype_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_13media_subtype_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value) {
  struct ifreq __pyx_v_ifr;
  struct ifmediareq __pyx_v_ifm;
  struct ifmedia_description *__pyx_v_ifmt;
  struct ifmedia_type_to_subtype *__pyx_v_ttos;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char const *__pyx_t_8;
  char const *__pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":823
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":824
 * 
 *             if not self.query_media(&ifm):
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_current)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 824, __pyx_L1_error)

    /* "netif.pyx":823
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":826
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_current)             # <<<<<<<<<<<<<<
 *             ifmt = get_subtype_by_name(value, ttos)
 * 
 */
  __pyx_v_ttos = get_toptype_ttos(__pyx_v_ifm.ifm_current);

  /* "netif.pyx":827
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_current)
 *             ifmt = get_subtype_by_name(value, ttos)             # <<<<<<<<<<<<<<
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))
 */
  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L1_error)
  __pyx_v_ifmt = get_subtype_by_name(__pyx_t_8, __pyx_v_ttos);

  /* "netif.pyx":829
 *             ifmt = get_subtype_by_name(value, ttos)
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_media = ifmt.ifmt_word
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":830
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_media = ifmt.ifmt_word
 *             if self.ioctl(defs.SIOCSIFMEDIA, <void*>&ifr) == -1:
 */
  __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_9);

  /* "netif.pyx":831
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_media = ifmt.ifmt_word             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCSIFMEDIA, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_10 = __pyx_v_ifmt->ifmt_word;
  __pyx_v_ifr.ifr_ifru.ifru_media = __pyx_t_10;

  /* "netif.pyx":832
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_media = ifmt.ifmt_word
 *             if self.ioctl(defs.SIOCSIFMEDIA, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_1 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFMEDIA, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":833
 *             ifr.ifr_ifru.ifru_media = ifmt.ifmt_word
 *             if self.ioctl(defs.SIOCSIFMEDIA, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property active_media_subtype:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 833, __pyx_L1_error)

    /* "netif.pyx":832
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_media = ifmt.ifmt_word
 *             if self.ioctl(defs.SIOCSIFMEDIA, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":817
 *             return ifmt.ifmt_string.decode('ascii')
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.ifmediareq ifm
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.media_subtype.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":836
 * 
 *     property active_media_subtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_20active_media_subtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_20active_media_subtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_20active_media_subtype___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_20active_media_subtype___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifmediareq __pyx_v_ifm;
  struct ifmedia_description *__pyx_v_ifmt;
  struct ifmedia_type_to_subtype *__pyx_v_ttos;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char const *__pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":841
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":842
 * 
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    __pyx_t_1 = ((errno == 22) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":843
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument
 *                     return None             # <<<<<<<<<<<<<<
 * 
 *                 raise OSError(errno, os.strerror(errno))
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;

      /* "netif.pyx":842
 * 
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return None
 * 
 */
    }

    /* "netif.pyx":845
 *                     return None
 * 
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_active)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 845, __pyx_L1_error)

    /* "netif.pyx":841
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return None
 */
  }

  /* "netif.pyx":847
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_active)             # <<<<<<<<<<<<<<
 *             ifmt = get_subtype_desc(ifm.ifm_active, ttos)
 *             return ifmt.ifmt_string.decode('ascii')
 */
  __pyx_v_ttos = get_toptype_ttos(__pyx_v_ifm.ifm_active);

  /* "netif.pyx":848
 * 
 *             ttos = get_toptype_ttos(ifm.ifm_active)
 *             ifmt = get_subtype_desc(ifm.ifm_active, ttos)             # <<<<<<<<<<<<<<
 *             return ifmt.ifmt_string.decode('ascii')
 * 
 */
  __pyx_v_ifmt = get_subtype_desc(__pyx_v_ifm.ifm_active, __pyx_v_ttos);

  /* "netif.pyx":849
 *             ttos = get_toptype_ttos(ifm.ifm_active)
 *             ifmt = get_subtype_desc(ifm.ifm_active, ttos)
 *             return ifmt.ifmt_string.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *     property media_options:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_v_ifmt->ifmt_string;
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":836
 * 
 *     property active_media_subtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.active_media_subtype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":852
 * 
 *     property media_options:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_13media_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_13media_options_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_13media_options___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_13media_options___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifmediareq __pyx_v_ifm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":857
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return set()
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":858
 * 
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return set()
 * 
 */
    __pyx_t_1 = ((errno == 22) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":859
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument
 *                     return set()             # <<<<<<<<<<<<<<
 * 
 *                 raise OSError(errno, os.strerror(errno))
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "netif.pyx":858
 * 
 *             if not self.query_media(&ifm):
 *                 if errno == 22: # Invalid argument             # <<<<<<<<<<<<<<
 *                     return set()
 * 
 */
    }

    /* "netif.pyx":861
 *                     return set()
 * 
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             return bitmask_to_set(ifm.ifm_current, InterfaceMediaOption)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 861, __pyx_L1_error)

    /* "netif.pyx":857
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 if errno == 22: # Invalid argument
 *                     return set()
 */
  }

  /* "netif.pyx":863
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             return bitmask_to_set(ifm.ifm_current, InterfaceMediaOption)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ifm.ifm_current); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceMediaOption); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_7 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":852
 * 
 *     property media_options:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.NetworkInterface.media_options.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":865
 *             return bitmask_to_set(ifm.ifm_current, InterfaceMediaOption)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_13media_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_13media_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_13media_options_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_13media_options_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value) {
  struct ifmediareq __pyx_v_ifm;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":870
 *             cdef ifmedia_type_to_subtype* ttos
 * 
 *             ifm.ifm_current = set_to_bitmask(value)             # <<<<<<<<<<<<<<
 * 
 *             if not self.query_media(&ifm):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_to_bitmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_value);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ifm.ifm_current = __pyx_t_5;

  /* "netif.pyx":872
 *             ifm.ifm_current = set_to_bitmask(value)
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_6 = ((!(((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->query_media(__pyx_v_self, (&__pyx_v_ifm)) != 0)) != 0);
  if (__pyx_t_6) {

    /* "netif.pyx":873
 * 
 *             if not self.query_media(&ifm):
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property description:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 873, __pyx_L1_error)

    /* "netif.pyx":872
 *             ifm.ifm_current = set_to_bitmask(value)
 * 
 *             if not self.query_media(&ifm):             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":865
 *             return bitmask_to_set(ifm.ifm_current, InterfaceMediaOption)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifmediareq ifm
 *             cdef defs.ifmedia_description* ifmt
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.media_options.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":876
 * 
 *     property description:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef char buffer[1024]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_11description_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_11description_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_11description___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_11description___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  char __pyx_v_buffer[0x400];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":880
 *             cdef char buffer[1024]
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":881
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":882
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 * 
 */
  __pyx_v_ifr.ifr_ifru.ifru_buffer.length = (sizeof(__pyx_v_buffer));

  /* "netif.pyx":883
 *             strcpy(ifr.ifr_name, self.nameb)
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer             # <<<<<<<<<<<<<<
 * 
 *             if self.ioctl(defs.SIOCGIFDESCR, <void*>&ifr) == -1:
 */
  __pyx_v_ifr.ifr_ifru.ifru_buffer.buffer = __pyx_v_buffer;

  /* "netif.pyx":885
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 * 
 *             if self.ioctl(defs.SIOCGIFDESCR, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCGIFDESCR, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":886
 * 
 *             if self.ioctl(defs.SIOCGIFDESCR, <void*>&ifr) == -1:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *             return buffer.decode('utf-8')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "netif.pyx":885
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 * 
 *             if self.ioctl(defs.SIOCGIFDESCR, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
  }

  /* "netif.pyx":888
 *                 return None
 * 
 *             return buffer.decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, descr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_buffer, 0, strlen(__pyx_v_buffer), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":876
 * 
 *     property description:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef char buffer[1024]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.NetworkInterface.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":890
 *             return buffer.decode('utf-8')
 * 
 *         def __set__(self, descr):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef char buffer[1024]
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_11description_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_descr); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_11description_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_descr) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_11description_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_descr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_11description_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_descr) {
  struct ifreq __pyx_v_ifr;
  char __pyx_v_buffer[0x400];
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":894
 *             cdef char buffer[1024]
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 *             strcpy(buffer, descr.encode('utf-8'))
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":895
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *             strcpy(buffer, descr.encode('utf-8'))
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 895, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":896
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             strcpy(buffer, descr.encode('utf-8'))             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L1_error)
  strcpy(__pyx_v_buffer, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":897
 *             strcpy(ifr.ifr_name, self.nameb)
 *             strcpy(buffer, descr.encode('utf-8'))
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 * 
 */
  __pyx_v_ifr.ifr_ifru.ifru_buffer.length = (sizeof(__pyx_v_buffer));

  /* "netif.pyx":898
 *             strcpy(buffer, descr.encode('utf-8'))
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer             # <<<<<<<<<<<<<<
 * 
 *             if self.ioctl(defs.SIOCSIFDESCR, <void*>&ifr) == -1:
 */
  __pyx_v_ifr.ifr_ifru.ifru_buffer.buffer = __pyx_v_buffer;

  /* "netif.pyx":900
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 * 
 *             if self.ioctl(defs.SIOCSIFDESCR, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFDESCR, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_4) {

    /* "netif.pyx":901
 * 
 *             if self.ioctl(defs.SIOCSIFDESCR, <void*>&ifr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property carp_config:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 901, __pyx_L1_error)

    /* "netif.pyx":900
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 * 
 *             if self.ioctl(defs.SIOCSIFDESCR, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":890
 *             return buffer.decode('utf-8')
 * 
 *         def __set__(self, descr):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef char buffer[1024]
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.description.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_16NetworkInterface_11carp_config_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":904
 * 
 *     property carp_config:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.carpreq carpr[defs.CARP_MAXVHID]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_11carp_config_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_11carp_config_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_11carp_config___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_11carp_config___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct __pyx_obj_5netif___pyx_scope_struct____get__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct____get__ *)__pyx_tp_new_5netif___pyx_scope_struct____get__(__pyx_ptype_5netif___pyx_scope_struct____get__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_16NetworkInterface_11carp_config_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_NetworkInterface___get); if (unlikely(!gen)) __PYX_ERR(0, 904, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.NetworkInterface.carp_config.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_16NetworkInterface_11carp_config_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct____get__ *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct____get__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L11_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 904, __pyx_L1_error)

  /* "netif.pyx":908
 *             cdef defs.carpreq carpr[defs.CARP_MAXVHID]
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 * 
 */
  memset((&__pyx_cur_scope->__pyx_v_ifr), 0, (sizeof(__pyx_cur_scope->__pyx_v_ifr)));

  /* "netif.pyx":909
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 * 
 *             memset(&carpr, 0, cython.sizeof(carpr))
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_cur_scope->__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 909, __pyx_L1_error)
  strcpy(__pyx_cur_scope->__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":911
 *             strcpy(ifr.ifr_name, self.nameb)
 * 
 *             memset(&carpr, 0, cython.sizeof(carpr))             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 *             carpr[0].carpr_count = defs.CARP_MAXVHID
 */
  memset((&__pyx_cur_scope->__pyx_v_carpr), 0, (sizeof(__pyx_cur_scope->__pyx_v_carpr)));

  /* "netif.pyx":912
 * 
 *             memset(&carpr, 0, cython.sizeof(carpr))
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr             # <<<<<<<<<<<<<<
 *             carpr[0].carpr_count = defs.CARP_MAXVHID
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:
 */
  __pyx_cur_scope->__pyx_v_ifr.ifr_ifru.ifru_data = ((caddr_t)(&__pyx_cur_scope->__pyx_v_carpr));

  /* "netif.pyx":913
 *             memset(&carpr, 0, cython.sizeof(carpr))
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 *             carpr[0].carpr_count = defs.CARP_MAXVHID             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:
 *                 if errno == ENOENT:
 */
  (__pyx_cur_scope->__pyx_v_carpr[0]).carpr_count = CARP_MAXVHID;

  /* "netif.pyx":914
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 *             carpr[0].carpr_count = defs.CARP_MAXVHID
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 if errno == ENOENT:
 *                     return
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->ioctl(__pyx_cur_scope->__pyx_v_self, SIOCGVH, ((void *)(&__pyx_cur_scope->__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":915
 *             carpr[0].carpr_count = defs.CARP_MAXVHID
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:
 *                 if errno == ENOENT:             # <<<<<<<<<<<<<<
 *                     return
 *                 raise OSError(errno, os.strerror(errno))
 */
    __pyx_t_2 = ((errno == ENOENT) != 0);
    if (__pyx_t_2) {

      /* "netif.pyx":916
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:
 *                 if errno == ENOENT:
 *                     return             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = NULL;
      goto __pyx_L0;

      /* "netif.pyx":915
 *             carpr[0].carpr_count = defs.CARP_MAXVHID
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:
 *                 if errno == ENOENT:             # <<<<<<<<<<<<<<
 *                     return
 *                 raise OSError(errno, os.strerror(errno))
 */
    }

    /* "netif.pyx":917
 *                 if errno == ENOENT:
 *                     return
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             vhid_map = {}
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 917, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 917, __pyx_L1_error)

    /* "netif.pyx":914
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 *             carpr[0].carpr_count = defs.CARP_MAXVHID
 *             if self.ioctl(defs.SIOCGVH, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                 if errno == ENOENT:
 *                     return
 */
  }

  /* "netif.pyx":919
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             vhid_map = {}             # <<<<<<<<<<<<<<
 *             for addr in self.addresses:
 *                 if addr.vhid:
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_vhid_map = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "netif.pyx":920
 * 
 *             vhid_map = {}
 *             for addr in self.addresses:             # <<<<<<<<<<<<<<
 *                 if addr.vhid:
 *                     vhid_map[addr.vhid] = addr
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_self->addresses)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_self->addresses)) {
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->addresses; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_self->addresses); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 920, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 920, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 920, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 920, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 920, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_10(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 920, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_addr);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_addr, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "netif.pyx":921
 *             vhid_map = {}
 *             for addr in self.addresses:
 *                 if addr.vhid:             # <<<<<<<<<<<<<<
 *                     vhid_map[addr.vhid] = addr
 *             for i in xrange(carpr[0].carpr_count):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_addr, __pyx_n_s_vhid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_2) {

      /* "netif.pyx":922
 *             for addr in self.addresses:
 *                 if addr.vhid:
 *                     vhid_map[addr.vhid] = addr             # <<<<<<<<<<<<<<
 *             for i in xrange(carpr[0].carpr_count):
 *                 addr = vhid_map.get(carpr[i].carpr_vhid)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_addr, __pyx_n_s_vhid); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_vhid_map, __pyx_t_6, __pyx_cur_scope->__pyx_v_addr) < 0)) __PYX_ERR(0, 922, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "netif.pyx":921
 *             vhid_map = {}
 *             for addr in self.addresses:
 *                 if addr.vhid:             # <<<<<<<<<<<<<<
 *                     vhid_map[addr.vhid] = addr
 *             for i in xrange(carpr[0].carpr_count):
 */
    }

    /* "netif.pyx":920
 * 
 *             vhid_map = {}
 *             for addr in self.addresses:             # <<<<<<<<<<<<<<
 *                 if addr.vhid:
 *                     vhid_map[addr.vhid] = addr
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":923
 *                 if addr.vhid:
 *                     vhid_map[addr.vhid] = addr
 *             for i in xrange(carpr[0].carpr_count):             # <<<<<<<<<<<<<<
 *                 addr = vhid_map.get(carpr[i].carpr_vhid)
 *                 yield CarpConfig(carpr[i].carpr_vhid, addr, carpr[i].carpr_advbase, carpr[i].carpr_advskew, carpr[i].carpr_key, carpr[i].carpr_state)
 */
  __pyx_t_11 = (__pyx_cur_scope->__pyx_v_carpr[0]).carpr_count;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_12;

    /* "netif.pyx":924
 *                     vhid_map[addr.vhid] = addr
 *             for i in xrange(carpr[0].carpr_count):
 *                 addr = vhid_map.get(carpr[i].carpr_vhid)             # <<<<<<<<<<<<<<
 *                 yield CarpConfig(carpr[i].carpr_vhid, addr, carpr[i].carpr_advbase, carpr[i].carpr_advskew, carpr[i].carpr_key, carpr[i].carpr_state)
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_carpr[__pyx_cur_scope->__pyx_v_i]).carpr_vhid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_vhid_map, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_addr);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_addr, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "netif.pyx":925
 *             for i in xrange(carpr[0].carpr_count):
 *                 addr = vhid_map.get(carpr[i].carpr_vhid)
 *                 yield CarpConfig(carpr[i].carpr_vhid, addr, carpr[i].carpr_advbase, carpr[i].carpr_advskew, carpr[i].carpr_key, carpr[i].carpr_state)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CarpConfig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_carpr[__pyx_cur_scope->__pyx_v_i]).carpr_vhid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_carpr[__pyx_cur_scope->__pyx_v_i]).carpr_advbase); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_carpr[__pyx_cur_scope->__pyx_v_i]).carpr_advskew); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FromCString((__pyx_cur_scope->__pyx_v_carpr[__pyx_cur_scope->__pyx_v_i]).carpr_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_carpr[__pyx_cur_scope->__pyx_v_i]).carpr_state); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_9 = 1;
      }
    }
    __pyx_t_15 = PyTuple_New(6+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    if (__pyx_t_14) {
      __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_addr);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_addr);
    PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v_addr);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_9, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_15, 4+__pyx_t_9, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_15, 5+__pyx_t_9, __pyx_t_13);
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_t_13 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_11;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_12;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L11_resume_from_yield:;
    __pyx_t_11 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_12 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 925, __pyx_L1_error)
  }

  /* "netif.pyx":904
 * 
 *     property carp_config:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.carpreq carpr[defs.CARP_MAXVHID]
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":927
 *                 yield CarpConfig(carpr[i].carpr_vhid, addr, carpr[i].carpr_advbase, carpr[i].carpr_advskew, carpr[i].carpr_key, carpr[i].carpr_state)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.carpreq carpr
 */

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_11carp_config_4__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_11carp_config_4__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_11carp_config_3__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_11carp_config_3__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value) {
  struct ifreq __pyx_v_ifr;
  struct carpreq __pyx_v_carpr;
  PyObject *__pyx_v_v = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":931
 *             cdef defs.carpreq carpr
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *             strcpy(ifr.ifr_name, self.nameb)
 * 
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":932
 * 
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 * 
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":934
 *             strcpy(ifr.ifr_name, self.nameb)
 * 
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr             # <<<<<<<<<<<<<<
 * 
 *             for v in value:
 */
  __pyx_v_ifr.ifr_ifru.ifru_data = ((caddr_t)(&__pyx_v_carpr));

  /* "netif.pyx":936
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 * 
 *             for v in value:             # <<<<<<<<<<<<<<
 * 
 *                 memset(&carpr, 0, cython.sizeof(carpr))
 */
  if (likely(PyList_CheckExact(__pyx_v_value)) || PyTuple_CheckExact(__pyx_v_value)) {
    __pyx_t_2 = __pyx_v_value; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 936, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "netif.pyx":938
 *             for v in value:
 * 
 *                 memset(&carpr, 0, cython.sizeof(carpr))             # <<<<<<<<<<<<<<
 *                 carpr.carpr_count = 1
 * 
 */
    memset((&__pyx_v_carpr), 0, (sizeof(__pyx_v_carpr)));

    /* "netif.pyx":939
 * 
 *                 memset(&carpr, 0, cython.sizeof(carpr))
 *                 carpr.carpr_count = 1             # <<<<<<<<<<<<<<
 * 
 *                 carpr.carpr_vhid = v.vhid
 */
    __pyx_v_carpr.carpr_count = 1;

    /* "netif.pyx":941
 *                 carpr.carpr_count = 1
 * 
 *                 carpr.carpr_vhid = v.vhid             # <<<<<<<<<<<<<<
 *                 if v.advbase is not None:
 *                     carpr.carpr_advbase = v.advbase
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_vhid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_carpr.carpr_vhid = __pyx_t_6;

    /* "netif.pyx":942
 * 
 *                 carpr.carpr_vhid = v.vhid
 *                 if v.advbase is not None:             # <<<<<<<<<<<<<<
 *                     carpr.carpr_advbase = v.advbase
 *                 if v.advskew is not None:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_advbase); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":943
 *                 carpr.carpr_vhid = v.vhid
 *                 if v.advbase is not None:
 *                     carpr.carpr_advbase = v.advbase             # <<<<<<<<<<<<<<
 *                 if v.advskew is not None:
 *                     carpr.carpr_advskew = v.advskew
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_advbase); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 943, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_carpr.carpr_advbase = __pyx_t_6;

      /* "netif.pyx":942
 * 
 *                 carpr.carpr_vhid = v.vhid
 *                 if v.advbase is not None:             # <<<<<<<<<<<<<<
 *                     carpr.carpr_advbase = v.advbase
 *                 if v.advskew is not None:
 */
    }

    /* "netif.pyx":944
 *                 if v.advbase is not None:
 *                     carpr.carpr_advbase = v.advbase
 *                 if v.advskew is not None:             # <<<<<<<<<<<<<<
 *                     carpr.carpr_advskew = v.advskew
 *                 if v.key:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_advskew); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {

      /* "netif.pyx":945
 *                     carpr.carpr_advbase = v.advbase
 *                 if v.advskew is not None:
 *                     carpr.carpr_advskew = v.advskew             # <<<<<<<<<<<<<<
 *                 if v.key:
 *                     strcpy(<char *>carpr.carpr_key, v.key)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_advskew); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_carpr.carpr_advskew = __pyx_t_6;

      /* "netif.pyx":944
 *                 if v.advbase is not None:
 *                     carpr.carpr_advbase = v.advbase
 *                 if v.advskew is not None:             # <<<<<<<<<<<<<<
 *                     carpr.carpr_advskew = v.advskew
 *                 if v.key:
 */
    }

    /* "netif.pyx":946
 *                 if v.advskew is not None:
 *                     carpr.carpr_advskew = v.advskew
 *                 if v.key:             # <<<<<<<<<<<<<<
 *                     strcpy(<char *>carpr.carpr_key, v.key)
 *                 if v.state is not None:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 946, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {

      /* "netif.pyx":947
 *                     carpr.carpr_advskew = v.advskew
 *                 if v.key:
 *                     strcpy(<char *>carpr.carpr_key, v.key)             # <<<<<<<<<<<<<<
 *                 if v.state is not None:
 *                     carpr.carpr_state = v.state.value
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L1_error)
      strcpy(((char *)__pyx_v_carpr.carpr_key), __pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "netif.pyx":946
 *                 if v.advskew is not None:
 *                     carpr.carpr_advskew = v.advskew
 *                 if v.key:             # <<<<<<<<<<<<<<
 *                     strcpy(<char *>carpr.carpr_key, v.key)
 *                 if v.state is not None:
 */
    }

    /* "netif.pyx":948
 *                 if v.key:
 *                     strcpy(<char *>carpr.carpr_key, v.key)
 *                 if v.state is not None:             # <<<<<<<<<<<<<<
 *                     carpr.carpr_state = v.state.value
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":949
 *                     strcpy(<char *>carpr.carpr_key, v.key)
 *                 if v.state is not None:
 *                     carpr.carpr_state = v.state.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_carpr.carpr_state = __pyx_t_6;

      /* "netif.pyx":948
 *                 if v.key:
 *                     strcpy(<char *>carpr.carpr_key, v.key)
 *                 if v.state is not None:             # <<<<<<<<<<<<<<
 *                     carpr.carpr_state = v.state.value
 * 
 */
    }

    /* "netif.pyx":952
 * 
 * 
 *                 if self.ioctl(defs.SIOCSVH, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                     raise OSError(errno, os.strerror(errno))
 * 
 */
    __pyx_t_8 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSVH, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":953
 * 
 *                 if self.ioctl(defs.SIOCSVH, <void*>&ifr) == -1:
 *                     raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *                 if v.addr and v.addr.vhid != v.vhid:
 */
      __pyx_t_9 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strerror); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 953, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5);
      __pyx_t_9 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 953, __pyx_L1_error)

      /* "netif.pyx":952
 * 
 * 
 *                 if self.ioctl(defs.SIOCSVH, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *                     raise OSError(errno, os.strerror(errno))
 * 
 */
    }

    /* "netif.pyx":955
 *                     raise OSError(errno, os.strerror(errno))
 * 
 *                 if v.addr and v.addr.vhid != v.vhid:             # <<<<<<<<<<<<<<
 *                     self.remove_address(v.addr)
 *                     v.addr.vhid = v.vhid
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_addr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {
    } else {
      __pyx_t_8 = __pyx_t_7;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_addr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_vhid); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_vhid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_11, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = __pyx_t_7;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_8) {

      /* "netif.pyx":956
 * 
 *                 if v.addr and v.addr.vhid != v.vhid:
 *                     self.remove_address(v.addr)             # <<<<<<<<<<<<<<
 *                     v.addr.vhid = v.vhid
 *                     self.add_address(v.addr)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_addr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_13) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 956, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_9);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 956, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 956, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "netif.pyx":957
 *                 if v.addr and v.addr.vhid != v.vhid:
 *                     self.remove_address(v.addr)
 *                     v.addr.vhid = v.vhid             # <<<<<<<<<<<<<<
 *                     self.add_address(v.addr)
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_vhid); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_addr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_vhid, __pyx_t_9) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "netif.pyx":958
 *                     self.remove_address(v.addr)
 *                     v.addr.vhid = v.vhid
 *                     self.add_address(v.addr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_address); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_addr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 958, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "netif.pyx":955
 *                     raise OSError(errno, os.strerror(errno))
 * 
 *                 if v.addr and v.addr.vhid != v.vhid:             # <<<<<<<<<<<<<<
 *                     self.remove_address(v.addr)
 *                     v.addr.vhid = v.vhid
 */
    }

    /* "netif.pyx":936
 *             ifr.ifr_ifru.ifru_data = <defs.caddr_t>&carpr
 * 
 *             for v in value:             # <<<<<<<<<<<<<<
 * 
 *                 memset(&carpr, 0, cython.sizeof(carpr))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":927
 *                 yield CarpConfig(carpr[i].carpr_vhid, addr, carpr[i].carpr_advbase, carpr[i].carpr_advskew, carpr[i].carpr_key, carpr[i].carpr_state)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.ifreq ifr
 *             cdef defs.carpreq carpr
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("netif.NetworkInterface.carp_config.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":961
 * 
 * 
 *     def add_address(self, address):             # <<<<<<<<<<<<<<
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_9add_address(PyObject *__pyx_v_self, PyObject *__pyx_v_address); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_9add_address(PyObject *__pyx_v_self, PyObject *__pyx_v_address) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_address (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_8add_address(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_address));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_8add_address(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_address) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("add_address", 0);

  /* "netif.pyx":962
 * 
 *     def add_address(self, address):
 *         if address.af == AddressFamily.INET6:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_af); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INET6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":963
 *     def add_address(self, address):
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)             # <<<<<<<<<<<<<<
 *         elif address.af == AddressFamily.INET:
 *             self.aliasreq(address, defs.SIOCAIFADDR)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->aliasreq(__pyx_v_self, __pyx_v_address, SIOCAIFADDR_IN6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "netif.pyx":962
 * 
 *     def add_address(self, address):
 *         if address.af == AddressFamily.INET6:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:
 */
    goto __pyx_L3;
  }

  /* "netif.pyx":964
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCAIFADDR)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":965
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:
 *             self.aliasreq(address, defs.SIOCAIFADDR)             # <<<<<<<<<<<<<<
 * 
 *     def remove_address(self, address):
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->aliasreq(__pyx_v_self, __pyx_v_address, SIOCAIFADDR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":964
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCAIFADDR)
 * 
 */
  }
  __pyx_L3:;

  /* "netif.pyx":961
 * 
 * 
 *     def add_address(self, address):             # <<<<<<<<<<<<<<
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCAIFADDR_IN6)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.NetworkInterface.add_address", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":967
 *             self.aliasreq(address, defs.SIOCAIFADDR)
 * 
 *     def remove_address(self, address):             # <<<<<<<<<<<<<<
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_11remove_address(PyObject *__pyx_v_self, PyObject *__pyx_v_address); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_11remove_address(PyObject *__pyx_v_self, PyObject *__pyx_v_address) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_address (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_10remove_address(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_address));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_10remove_address(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_address) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("remove_address", 0);

  /* "netif.pyx":968
 * 
 *     def remove_address(self, address):
 *         if address.af == AddressFamily.INET6:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_af); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INET6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":969
 *     def remove_address(self, address):
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)             # <<<<<<<<<<<<<<
 *         elif address.af == AddressFamily.INET:
 *             self.aliasreq(address, defs.SIOCDIFADDR)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->aliasreq(__pyx_v_self, __pyx_v_address, SIOCDIFADDR_IN6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "netif.pyx":968
 * 
 *     def remove_address(self, address):
 *         if address.af == AddressFamily.INET6:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:
 */
    goto __pyx_L3;
  }

  /* "netif.pyx":970
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCDIFADDR)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_address, __pyx_n_s_af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":971
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:
 *             self.aliasreq(address, defs.SIOCDIFADDR)             # <<<<<<<<<<<<<<
 * 
 *     def down(self):
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->aliasreq(__pyx_v_self, __pyx_v_address, SIOCDIFADDR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":970
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 *         elif address.af == AddressFamily.INET:             # <<<<<<<<<<<<<<
 *             self.aliasreq(address, defs.SIOCDIFADDR)
 * 
 */
  }
  __pyx_L3:;

  /* "netif.pyx":967
 *             self.aliasreq(address, defs.SIOCAIFADDR)
 * 
 *     def remove_address(self, address):             # <<<<<<<<<<<<<<
 *         if address.af == AddressFamily.INET6:
 *             self.aliasreq(address, defs.SIOCDIFADDR_IN6)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.NetworkInterface.remove_address", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":973
 *             self.aliasreq(address, defs.SIOCDIFADDR)
 * 
 *     def down(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_13down(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_13down(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("down (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_12down(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_12down(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  uint32_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("down", 0);

  /* "netif.pyx":975
 *     def down(self):
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() & ~defs.IFF_UP
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":976
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() & ~defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":977
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() & ~defs.IFF_UP             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->__pyx___get_flags(__pyx_v_self); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L1_error)
  (__pyx_v_ifr.ifr_ifru.ifru_flags[0]) = (__pyx_t_2 & (~IFF_UP));

  /* "netif.pyx":978
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() & ~defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_3 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFFLAGS, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":979
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() & ~defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     def up(self):
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 979, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 979, __pyx_L1_error)

    /* "netif.pyx":978
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() & ~defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":973
 *             self.aliasreq(address, defs.SIOCDIFADDR)
 * 
 *     def down(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.NetworkInterface.down", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":981
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def up(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_15up(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_15up(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("up (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_14up(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_14up(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  uint32_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("up", 0);

  /* "netif.pyx":983
 *     def up(self):
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() | defs.IFF_UP
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":984
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() | defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 984, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":985
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() | defs.IFF_UP             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->__pyx___get_flags(__pyx_v_self); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) __PYX_ERR(0, 985, __pyx_L1_error)
  (__pyx_v_ifr.ifr_ifru.ifru_flags[0]) = (__pyx_t_2 | IFF_UP);

  /* "netif.pyx":986
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() | defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_3 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFFLAGS, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":987
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() | defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     def rename(self, name):
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 987, __pyx_L1_error)

    /* "netif.pyx":986
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_flags[0] = self.__get_flags() | defs.IFF_UP
 *         if self.ioctl(defs.SIOCSIFFLAGS, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":981
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def up(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         memset(&ifr, 0, cython.sizeof(ifr))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.NetworkInterface.up", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":989
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def rename(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef char newname[defs.IFNAMSIZ]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_17rename(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_17rename(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rename (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_16rename(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_16rename(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  struct ifreq __pyx_v_ifr;
  char __pyx_v_newname[IFNAMSIZ];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("rename", 0);

  /* "netif.pyx":993
 *         cdef char newname[defs.IFNAMSIZ]
 * 
 *         memset(&ifr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(newname, name.encode('ascii'))
 */
  memset((&__pyx_v_ifr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":994
 * 
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *         strcpy(newname, name.encode('ascii'))
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t><void*>newname
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":995
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(newname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t><void*>newname
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 995, __pyx_L1_error)
  strcpy(__pyx_v_newname, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":996
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(newname, name.encode('ascii'))
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t><void*>newname             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCSIFNAME, <void*>&ifr) == -1:
 */
  __pyx_v_ifr.ifr_ifru.ifru_data = ((caddr_t)((void *)__pyx_v_newname));

  /* "netif.pyx":998
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t><void*>newname
 * 
 *         if self.ioctl(defs.SIOCSIFNAME, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_NetworkInterface *)__pyx_v_self->__pyx_vtab)->ioctl(__pyx_v_self, SIOCSIFNAME, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_4) {

    /* "netif.pyx":999
 * 
 *         if self.ioctl(defs.SIOCSIFNAME, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *         self.name = name
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 999, __pyx_L1_error)

    /* "netif.pyx":998
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t><void*>newname
 * 
 *         if self.ioctl(defs.SIOCSIFNAME, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1001
 *             raise OSError(errno, os.strerror(errno))
 * 
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.nameb = name.encode('ascii')
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "netif.pyx":1002
 * 
 *         self.name = name
 *         self.nameb = name.encode('ascii')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->nameb);
  __Pyx_DECREF(__pyx_v_self->nameb);
  __pyx_v_self->nameb = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "netif.pyx":989
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def rename(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef char newname[defs.IFNAMSIZ]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.NetworkInterface.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":559
 * 
 * cdef class NetworkInterface(object):
 *     cdef readonly object name             # <<<<<<<<<<<<<<
 *     cdef object nameb
 *     cdef public object type
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_4name___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_4name___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":561
 *     cdef readonly object name
 *     cdef object nameb
 *     cdef public object type             # <<<<<<<<<<<<<<
 *     cdef readonly object addresses
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_4type___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_4type___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->type);
  __pyx_r = __pyx_v_self->type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_4type_2__set__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_4type_2__set__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(__pyx_v_self->type);
  __pyx_v_self->type = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5netif_16NetworkInterface_4type_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5netif_16NetworkInterface_4type_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_4type_4__del__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_16NetworkInterface_4type_4__del__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(__pyx_v_self->type);
  __pyx_v_self->type = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":562
 *     cdef object nameb
 *     cdef public object type
 *     cdef readonly object addresses             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, name):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_16NetworkInterface_9addresses_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_16NetworkInterface_9addresses_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16NetworkInterface_9addresses___get__(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16NetworkInterface_9addresses___get__(struct __pyx_obj_5netif_NetworkInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->addresses);
  __pyx_r = __pyx_v_self->addresses;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1006
 * 
 * class CarpConfig(object):
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):             # <<<<<<<<<<<<<<
 *         self.vhid = vhid
 *         self.addr = addr
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_10CarpConfig_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_10CarpConfig_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5netif_10CarpConfig_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_10CarpConfig_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_vhid = 0;
  PyObject *__pyx_v_addr = 0;
  PyObject *__pyx_v_advbase = 0;
  PyObject *__pyx_v_advskew = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vhid,&__pyx_n_s_addr,&__pyx_n_s_advbase,&__pyx_n_s_advskew,&__pyx_n_s_key,&__pyx_n_s_state,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vhid)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 7, 1); __PYX_ERR(0, 1006, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_addr);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_advbase);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_advskew);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1006, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_vhid = values[1];
    __pyx_v_addr = values[2];
    __pyx_v_advbase = values[3];
    __pyx_v_advskew = values[4];
    __pyx_v_key = values[5];
    __pyx_v_state = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1006, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.CarpConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_10CarpConfig___init__(__pyx_self, __pyx_v_self, __pyx_v_vhid, __pyx_v_addr, __pyx_v_advbase, __pyx_v_advskew, __pyx_v_key, __pyx_v_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_10CarpConfig___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vhid, PyObject *__pyx_v_addr, PyObject *__pyx_v_advbase, PyObject *__pyx_v_advskew, PyObject *__pyx_v_key, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1007
 * class CarpConfig(object):
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):
 *         self.vhid = vhid             # <<<<<<<<<<<<<<
 *         self.addr = addr
 *         self.advbase = advbase
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vhid, __pyx_v_vhid) < 0) __PYX_ERR(0, 1007, __pyx_L1_error)

  /* "netif.pyx":1008
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):
 *         self.vhid = vhid
 *         self.addr = addr             # <<<<<<<<<<<<<<
 *         self.advbase = advbase
 *         self.advskew = advskew
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_addr, __pyx_v_addr) < 0) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "netif.pyx":1009
 *         self.vhid = vhid
 *         self.addr = addr
 *         self.advbase = advbase             # <<<<<<<<<<<<<<
 *         self.advskew = advskew
 *         self.key = key
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_advbase, __pyx_v_advbase) < 0) __PYX_ERR(0, 1009, __pyx_L1_error)

  /* "netif.pyx":1010
 *         self.addr = addr
 *         self.advbase = advbase
 *         self.advskew = advskew             # <<<<<<<<<<<<<<
 *         self.key = key
 *         self.state = CarpState(state) if state is not None else None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_advskew, __pyx_v_advskew) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)

  /* "netif.pyx":1011
 *         self.advbase = advbase
 *         self.advskew = advskew
 *         self.key = key             # <<<<<<<<<<<<<<
 *         self.state = CarpState(state) if state is not None else None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)

  /* "netif.pyx":1012
 *         self.advskew = advskew
 *         self.key = key
 *         self.state = CarpState(state) if state is not None else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_state != Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CarpState); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_state);
      __Pyx_GIVEREF(__pyx_v_state);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_state);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_state, __pyx_t_1) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1006
 * 
 * class CarpConfig(object):
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):             # <<<<<<<<<<<<<<
 *         self.vhid = vhid
 *         self.addr = addr
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.CarpConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1016
 * 
 * cdef class LaggInterface(NetworkInterface):
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(LaggInterface, self).__getstate__()
 *         state.update({
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13LaggInterface_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_13LaggInterface_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13LaggInterface___getstate__(((struct __pyx_obj_5netif_LaggInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13LaggInterface___getstate__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1017
 * cdef class LaggInterface(NetworkInterface):
 *     def __getstate__(self):
 *         state = super(LaggInterface, self).__getstate__()             # <<<<<<<<<<<<<<
 *         state.update({
 *             'protocol': self.protocol.name,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_LaggInterface));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_LaggInterface));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_LaggInterface));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1018
 *     def __getstate__(self):
 *         state = super(LaggInterface, self).__getstate__()
 *         state.update({             # <<<<<<<<<<<<<<
 *             'protocol': self.protocol.name,
 *             'ports': [{'name': p, 'flags': [x.name for x in f]} for p, f in self.ports]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1019
 *         state = super(LaggInterface, self).__getstate__()
 *         state.update({
 *             'protocol': self.protocol.name,             # <<<<<<<<<<<<<<
 *             'ports': [{'name': p, 'flags': [x.name for x in f]} for p, f in self.ports]
 *         })
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_protocol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_protocol, __pyx_t_5) < 0) __PYX_ERR(0, 1019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "netif.pyx":1020
 *         state.update({
 *             'protocol': self.protocol.name,
 *             'ports': [{'name': p, 'flags': [x.name for x in f]} for p, f in self.ports]             # <<<<<<<<<<<<<<
 *         })
 * 
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ports); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1020, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1020, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1020, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1020, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1020, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1020, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_p) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)
    __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (likely(PyList_CheckExact(__pyx_v_f)) || PyTuple_CheckExact(__pyx_v_f)) {
      __pyx_t_9 = __pyx_v_f; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1020, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_11 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1020, __pyx_L1_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1020, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        } else {
          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1020, __pyx_L1_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1020, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        }
      } else {
        __pyx_t_11 = __pyx_t_14(__pyx_t_9);
        if (unlikely(!__pyx_t_11)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1020, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_flags, __pyx_t_10) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1020, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ports, __pyx_t_5) < 0) __PYX_ERR(0, 1019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1023
 *         })
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     def add_port(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1016
 * 
 * cdef class LaggInterface(NetworkInterface):
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(LaggInterface, self).__getstate__()
 *         state.update({
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("netif.LaggInterface.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1025
 *         return state
 * 
 *     def add_port(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13LaggInterface_3add_port(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_5netif_13LaggInterface_3add_port(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_port (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13LaggInterface_2add_port(((struct __pyx_obj_5netif_LaggInterface *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13LaggInterface_2add_port(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  struct lagg_reqport __pyx_v_lreq;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("add_port", 0);

  /* "netif.pyx":1027
 *     def add_port(self, name):
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))             # <<<<<<<<<<<<<<
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 */
  memset((&__pyx_v_lreq), 0, (sizeof(__pyx_v_lreq)));

  /* "netif.pyx":1028
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))
 *         strcpy(lreq.rp_ifname, self.nameb)             # <<<<<<<<<<<<<<
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGPORT, <void*>&lreq) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1028, __pyx_L1_error)
  strcpy(__pyx_v_lreq.rp_ifname, __pyx_t_1);

  /* "netif.pyx":1029
 *         memset(&lreq, 0, cython.sizeof(lreq))
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSLAGGPORT, <void*>&lreq) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L1_error)
  strcpy(__pyx_v_lreq.rp_portname, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":1030
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGPORT, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_LaggInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCSLAGGPORT, ((void *)(&__pyx_v_lreq)), NULL) == -1L) != 0);
  if (__pyx_t_4) {

    /* "netif.pyx":1031
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGPORT, <void*>&lreq) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     def delete_port(self, name):
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1031, __pyx_L1_error)

    /* "netif.pyx":1030
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGPORT, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1025
 *         return state
 * 
 *     def add_port(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.LaggInterface.add_port", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1033
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def delete_port(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13LaggInterface_5delete_port(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_5netif_13LaggInterface_5delete_port(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_port (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13LaggInterface_4delete_port(((struct __pyx_obj_5netif_LaggInterface *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13LaggInterface_4delete_port(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  struct lagg_reqport __pyx_v_lreq;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("delete_port", 0);

  /* "netif.pyx":1035
 *     def delete_port(self, name):
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))             # <<<<<<<<<<<<<<
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 */
  memset((&__pyx_v_lreq), 0, (sizeof(__pyx_v_lreq)));

  /* "netif.pyx":1036
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))
 *         strcpy(lreq.rp_ifname, self.nameb)             # <<<<<<<<<<<<<<
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGDELPORT, <void*>&lreq) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L1_error)
  strcpy(__pyx_v_lreq.rp_ifname, __pyx_t_1);

  /* "netif.pyx":1037
 *         memset(&lreq, 0, cython.sizeof(lreq))
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSLAGGDELPORT, <void*>&lreq) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L1_error)
  strcpy(__pyx_v_lreq.rp_portname, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":1038
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGDELPORT, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_LaggInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCSLAGGDELPORT, ((void *)(&__pyx_v_lreq)), NULL) == -1L) != 0);
  if (__pyx_t_4) {

    /* "netif.pyx":1039
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGDELPORT, <void*>&lreq) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property protocol:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1039, __pyx_L1_error)

    /* "netif.pyx":1038
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))
 *         if self.ioctl(defs.SIOCSLAGGDELPORT, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1033
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def delete_port(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.lagg_reqport lreq
 *         memset(&lreq, 0, cython.sizeof(lreq))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.LaggInterface.delete_port", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1042
 * 
 *     property protocol:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13LaggInterface_8protocol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13LaggInterface_8protocol_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13LaggInterface_8protocol___get__(((struct __pyx_obj_5netif_LaggInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13LaggInterface_8protocol___get__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self) {
  struct lagg_reqall __pyx_v_lreq;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1044
 *         def __get__(self):
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))             # <<<<<<<<<<<<<<
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:
 */
  memset((&__pyx_v_lreq), 0, (sizeof(__pyx_v_lreq)));

  /* "netif.pyx":1045
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             strcpy(lreq.ra_ifname, self.nameb)             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1045, __pyx_L1_error)
  strcpy(__pyx_v_lreq.ra_ifname, __pyx_t_1);

  /* "netif.pyx":1046
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_LaggInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCGLAGG, ((void *)(&__pyx_v_lreq)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":1047
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             return AggregationProtocol(lreq.ra_proto)
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1047, __pyx_L1_error)

    /* "netif.pyx":1046
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1049
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             return AggregationProtocol(lreq.ra_proto)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_AggregationProtocol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_lreq.ra_proto); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1042
 * 
 *     property protocol:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.LaggInterface.protocol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1051
 *             return AggregationProtocol(lreq.ra_proto)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))
 */

/* Python wrapper */
static int __pyx_pw_5netif_13LaggInterface_8protocol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_13LaggInterface_8protocol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13LaggInterface_8protocol_2__set__(((struct __pyx_obj_5netif_LaggInterface *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_13LaggInterface_8protocol_2__set__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self, PyObject *__pyx_v_value) {
  struct lagg_reqall __pyx_v_lreq;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  uint32_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1053
 *         def __set__(self, value):
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))             # <<<<<<<<<<<<<<
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_proto = value.value
 */
  memset((&__pyx_v_lreq), 0, (sizeof(__pyx_v_lreq)));

  /* "netif.pyx":1054
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             strcpy(lreq.ra_ifname, self.nameb)             # <<<<<<<<<<<<<<
 *             lreq.ra_proto = value.value
 *             if self.ioctl(defs.SIOCSLAGG, <void*>&lreq) == -1:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1054, __pyx_L1_error)
  strcpy(__pyx_v_lreq.ra_ifname, __pyx_t_1);

  /* "netif.pyx":1055
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_proto = value.value             # <<<<<<<<<<<<<<
 *             if self.ioctl(defs.SIOCSLAGG, <void*>&lreq) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_lreq.ra_proto = __pyx_t_3;

  /* "netif.pyx":1056
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_proto = value.value
 *             if self.ioctl(defs.SIOCSLAGG, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_LaggInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCSLAGG, ((void *)(&__pyx_v_lreq)), NULL) == -1L) != 0);
  if (__pyx_t_4) {

    /* "netif.pyx":1057
 *             lreq.ra_proto = value.value
 *             if self.ioctl(defs.SIOCSLAGG, <void*>&lreq) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property ports:
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1057, __pyx_L1_error)

    /* "netif.pyx":1056
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_proto = value.value
 *             if self.ioctl(defs.SIOCSLAGG, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1051
 *             return AggregationProtocol(lreq.ra_proto)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             memset(&lreq, 0, cython.sizeof(lreq))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.LaggInterface.protocol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_13LaggInterface_5ports_2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":1060
 * 
 *     property ports:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             cdef defs.lagg_reqport lport[16]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13LaggInterface_5ports_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13LaggInterface_5ports_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13LaggInterface_5ports___get__(((struct __pyx_obj_5netif_LaggInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13LaggInterface_5ports___get__(struct __pyx_obj_5netif_LaggInterface *__pyx_v_self) {
  struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *)__pyx_tp_new_5netif___pyx_scope_struct_1___get__(__pyx_ptype_5netif___pyx_scope_struct_1___get__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_13LaggInterface_5ports_2generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_LaggInterface___get); if (unlikely(!gen)) __PYX_ERR(0, 1060, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.LaggInterface.ports.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_13LaggInterface_5ports_2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  long __pyx_t_10;
  char *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1060, __pyx_L1_error)

  /* "netif.pyx":1063
 *             cdef defs.lagg_reqall lreq
 *             cdef defs.lagg_reqport lport[16]
 *             memset(&lreq, 0, cython.sizeof(lreq))             # <<<<<<<<<<<<<<
 *             memset(lport, 0, cython.sizeof(lport))
 *             strcpy(lreq.ra_ifname, self.nameb)
 */
  memset((&__pyx_cur_scope->__pyx_v_lreq), 0, (sizeof(__pyx_cur_scope->__pyx_v_lreq)));

  /* "netif.pyx":1064
 *             cdef defs.lagg_reqport lport[16]
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             memset(lport, 0, cython.sizeof(lport))             # <<<<<<<<<<<<<<
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_size = cython.sizeof(lport)
 */
  memset(__pyx_cur_scope->__pyx_v_lport, 0, (sizeof(__pyx_cur_scope->__pyx_v_lport)));

  /* "netif.pyx":1065
 *             memset(&lreq, 0, cython.sizeof(lreq))
 *             memset(lport, 0, cython.sizeof(lport))
 *             strcpy(lreq.ra_ifname, self.nameb)             # <<<<<<<<<<<<<<
 *             lreq.ra_size = cython.sizeof(lport)
 *             lreq.ra_port = lport
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_cur_scope->__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1065, __pyx_L1_error)
  strcpy(__pyx_cur_scope->__pyx_v_lreq.ra_ifname, __pyx_t_1);

  /* "netif.pyx":1066
 *             memset(lport, 0, cython.sizeof(lport))
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_size = cython.sizeof(lport)             # <<<<<<<<<<<<<<
 *             lreq.ra_port = lport
 * 
 */
  __pyx_cur_scope->__pyx_v_lreq.ra_size = (sizeof(__pyx_cur_scope->__pyx_v_lport));

  /* "netif.pyx":1067
 *             strcpy(lreq.ra_ifname, self.nameb)
 *             lreq.ra_size = cython.sizeof(lport)
 *             lreq.ra_port = lport             # <<<<<<<<<<<<<<
 * 
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:
 */
  __pyx_cur_scope->__pyx_v_lreq.ra_port = __pyx_cur_scope->__pyx_v_lport;

  /* "netif.pyx":1069
 *             lreq.ra_port = lport
 * 
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_LaggInterface *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_cur_scope->__pyx_v_self), SIOCGLAGG, ((void *)(&__pyx_cur_scope->__pyx_v_lreq)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":1070
 * 
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *             for i in range(0, lreq.ra_ports):
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1070, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1070, __pyx_L1_error)

    /* "netif.pyx":1069
 *             lreq.ra_port = lport
 * 
 *             if self.ioctl(defs.SIOCGLAGG, <void*>&lreq) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1072
 *                 raise OSError(errno, os.strerror(errno))
 * 
 *             for i in range(0, lreq.ra_ports):             # <<<<<<<<<<<<<<
 *                 yield lport[i].rp_portname.decode('ascii'), bitmask_to_set(lport[i].rp_flags, LaggPortFlags)
 * 
 */
  __pyx_t_9 = __pyx_cur_scope->__pyx_v_lreq.ra_ports;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_10;

    /* "netif.pyx":1073
 * 
 *             for i in range(0, lreq.ra_ports):
 *                 yield lport[i].rp_portname.decode('ascii'), bitmask_to_set(lport[i].rp_flags, LaggPortFlags)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_11 = (__pyx_cur_scope->__pyx_v_lport[__pyx_cur_scope->__pyx_v_i]).rp_portname;
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_11, 0, strlen(__pyx_t_11), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyInt_From_uint32_t((__pyx_cur_scope->__pyx_v_lport[__pyx_cur_scope->__pyx_v_i]).rp_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_LaggPortFlags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_12 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_12 = 1;
      }
    }
    __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_5);
    __pyx_t_8 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_9;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_10;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    __pyx_t_9 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_10 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1073, __pyx_L1_error)
  }

  /* "netif.pyx":1060
 * 
 *     property ports:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.lagg_reqall lreq
 *             cdef defs.lagg_reqport lport[16]
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1077
 * 
 * cdef class BridgeInterface(NetworkInterface):
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(BridgeInterface, self).__getstate__()
 *         state.update({
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_15BridgeInterface_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_15BridgeInterface_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_15BridgeInterface___getstate__(((struct __pyx_obj_5netif_BridgeInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_15BridgeInterface___getstate__(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1078
 * cdef class BridgeInterface(NetworkInterface):
 *     def __getstate__(self):
 *         state = super(BridgeInterface, self).__getstate__()             # <<<<<<<<<<<<<<
 *         state.update({
 *             'members': list(self.members)
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_BridgeInterface));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_BridgeInterface));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_BridgeInterface));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1079
 *     def __getstate__(self):
 *         state = super(BridgeInterface, self).__getstate__()
 *         state.update({             # <<<<<<<<<<<<<<
 *             'members': list(self.members)
 *         })
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1080
 *         state = super(BridgeInterface, self).__getstate__()
 *         state.update({
 *             'members': list(self.members)             # <<<<<<<<<<<<<<
 *         })
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_members, __pyx_t_5) < 0) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1083
 *         })
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     def add_member(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1077
 * 
 * cdef class BridgeInterface(NetworkInterface):
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(BridgeInterface, self).__getstate__()
 *         state.update({
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.BridgeInterface.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1085
 *         return state
 * 
 *     def add_member(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.ifbreq ifbr
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_15BridgeInterface_3add_member(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_5netif_15BridgeInterface_3add_member(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_member (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_15BridgeInterface_2add_member(((struct __pyx_obj_5netif_BridgeInterface *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_15BridgeInterface_2add_member(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  struct ifbreq __pyx_v_ifbr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  __Pyx_RefNannySetupContext("add_member", 0);

  /* "netif.pyx":1088
 *         cdef defs.ifbreq ifbr
 * 
 *         strcpy(ifbr.ifbr_ifsname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         self.bridge_cmd(defs.BRDGADD, &ifbr, cython.sizeof(ifbr), True)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error)
  strcpy(__pyx_v_ifbr.ifbr_ifsname, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1089
 * 
 *         strcpy(ifbr.ifbr_ifsname, name.encode('ascii'))
 *         self.bridge_cmd(defs.BRDGADD, &ifbr, cython.sizeof(ifbr), True)             # <<<<<<<<<<<<<<
 * 
 *     def delete_member(self, name):
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(BRDGADD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5netif_BridgeInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->bridge_cmd(__pyx_v_self, __pyx_t_2, (&__pyx_v_ifbr), (sizeof(__pyx_v_ifbr)), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1085
 *         return state
 * 
 *     def add_member(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.ifbreq ifbr
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.BridgeInterface.add_member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1091
 *         self.bridge_cmd(defs.BRDGADD, &ifbr, cython.sizeof(ifbr), True)
 * 
 *     def delete_member(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.ifbreq ifbr
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_15BridgeInterface_5delete_member(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_5netif_15BridgeInterface_5delete_member(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_member (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_15BridgeInterface_4delete_member(((struct __pyx_obj_5netif_BridgeInterface *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_15BridgeInterface_4delete_member(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  struct ifbreq __pyx_v_ifbr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  __Pyx_RefNannySetupContext("delete_member", 0);

  /* "netif.pyx":1094
 *         cdef defs.ifbreq ifbr
 * 
 *         strcpy(ifbr.ifbr_ifsname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         self.bridge_cmd(defs.BRDGDEL, &ifbr, cython.sizeof(ifbr), True)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error)
  strcpy(__pyx_v_ifbr.ifbr_ifsname, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1095
 * 
 *         strcpy(ifbr.ifbr_ifsname, name.encode('ascii'))
 *         self.bridge_cmd(defs.BRDGDEL, &ifbr, cython.sizeof(ifbr), True)             # <<<<<<<<<<<<<<
 * 
 *     cdef bridge_cmd(self, cmd, void* arg, size_t size, int set):
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(BRDGDEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5netif_BridgeInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->bridge_cmd(__pyx_v_self, __pyx_t_2, (&__pyx_v_ifbr), (sizeof(__pyx_v_ifbr)), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1091
 *         self.bridge_cmd(defs.BRDGADD, &ifbr, cython.sizeof(ifbr), True)
 * 
 *     def delete_member(self, name):             # <<<<<<<<<<<<<<
 *         cdef defs.ifbreq ifbr
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.BridgeInterface.delete_member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1097
 *         self.bridge_cmd(defs.BRDGDEL, &ifbr, cython.sizeof(ifbr), True)
 * 
 *     cdef bridge_cmd(self, cmd, void* arg, size_t size, int set):             # <<<<<<<<<<<<<<
 *         cdef defs.ifdrv ifd
 * 
 */

static PyObject *__pyx_f_5netif_15BridgeInterface_bridge_cmd(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self, PyObject *__pyx_v_cmd, void *__pyx_v_arg, size_t __pyx_v_size, int __pyx_v_set) {
  struct ifdrv __pyx_v_ifd;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  unsigned long __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("bridge_cmd", 0);

  /* "netif.pyx":1100
 *         cdef defs.ifdrv ifd
 * 
 *         memset(&ifd, 0, cython.sizeof(ifd))             # <<<<<<<<<<<<<<
 *         strcpy(ifd.ifd_name, self.nameb)
 *         ifd.ifd_cmd = cmd
 */
  memset((&__pyx_v_ifd), 0, (sizeof(__pyx_v_ifd)));

  /* "netif.pyx":1101
 * 
 *         memset(&ifd, 0, cython.sizeof(ifd))
 *         strcpy(ifd.ifd_name, self.nameb)             # <<<<<<<<<<<<<<
 *         ifd.ifd_cmd = cmd
 *         ifd.ifd_len = size
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L1_error)
  strcpy(__pyx_v_ifd.ifd_name, __pyx_t_1);

  /* "netif.pyx":1102
 *         memset(&ifd, 0, cython.sizeof(ifd))
 *         strcpy(ifd.ifd_name, self.nameb)
 *         ifd.ifd_cmd = cmd             # <<<<<<<<<<<<<<
 *         ifd.ifd_len = size
 *         ifd.ifd_data = arg
 */
  __pyx_t_2 = __Pyx_PyInt_As_unsigned_long(__pyx_v_cmd); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1102, __pyx_L1_error)
  __pyx_v_ifd.ifd_cmd = __pyx_t_2;

  /* "netif.pyx":1103
 *         strcpy(ifd.ifd_name, self.nameb)
 *         ifd.ifd_cmd = cmd
 *         ifd.ifd_len = size             # <<<<<<<<<<<<<<
 *         ifd.ifd_data = arg
 * 
 */
  __pyx_v_ifd.ifd_len = __pyx_v_size;

  /* "netif.pyx":1104
 *         ifd.ifd_cmd = cmd
 *         ifd.ifd_len = size
 *         ifd.ifd_data = arg             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCSDRVSPEC if set else defs.SIOCGDRVSPEC, <void*>&ifd) == -1:
 */
  __pyx_v_ifd.ifd_data = __pyx_v_arg;

  /* "netif.pyx":1106
 *         ifd.ifd_data = arg
 * 
 *         if self.ioctl(defs.SIOCSDRVSPEC if set else defs.SIOCGDRVSPEC, <void*>&ifd) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  if ((__pyx_v_set != 0)) {
    __pyx_t_3 = SIOCSDRVSPEC;
  } else {
    __pyx_t_3 = SIOCGDRVSPEC;
  }
  __pyx_t_4 = ((((struct __pyx_vtabstruct_5netif_BridgeInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), __pyx_t_3, ((void *)(&__pyx_v_ifd)), NULL) == -1L) != 0);
  if (__pyx_t_4) {

    /* "netif.pyx":1107
 * 
 *         if self.ioctl(defs.SIOCSDRVSPEC if set else defs.SIOCGDRVSPEC, <void*>&ifd) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property members:
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_strerror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1107, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 1107, __pyx_L1_error)

    /* "netif.pyx":1106
 *         ifd.ifd_data = arg
 * 
 *         if self.ioctl(defs.SIOCSDRVSPEC if set else defs.SIOCGDRVSPEC, <void*>&ifd) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1097
 *         self.bridge_cmd(defs.BRDGDEL, &ifbr, cython.sizeof(ifbr), True)
 * 
 *     cdef bridge_cmd(self, cmd, void* arg, size_t size, int set):             # <<<<<<<<<<<<<<
 *         cdef defs.ifdrv ifd
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("netif.BridgeInterface.bridge_cmd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_15BridgeInterface_7members_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":1110
 * 
 *     property members:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifbreq* ifbr = NULL
 *             cdef defs.ifbifconf ifbc
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_15BridgeInterface_7members_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_15BridgeInterface_7members_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_15BridgeInterface_7members___get__(((struct __pyx_obj_5netif_BridgeInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_15BridgeInterface_7members___get__(struct __pyx_obj_5netif_BridgeInterface *__pyx_v_self) {
  struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *)__pyx_tp_new_5netif___pyx_scope_struct_2___get__(__pyx_ptype_5netif___pyx_scope_struct_2___get__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_15BridgeInterface_7members_2generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_BridgeInterface___get); if (unlikely(!gen)) __PYX_ERR(0, 1110, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.BridgeInterface.members.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_15BridgeInterface_7members_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  char *__pyx_t_6;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L9_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1110, __pyx_L1_error)

  /* "netif.pyx":1111
 *     property members:
 *         def __get__(self):
 *             cdef defs.ifbreq* ifbr = NULL             # <<<<<<<<<<<<<<
 *             cdef defs.ifbifconf ifbc
 *             cdef char *buf
 */
  __pyx_cur_scope->__pyx_v_ifbr = NULL;

  /* "netif.pyx":1114
 *             cdef defs.ifbifconf ifbc
 *             cdef char *buf
 *             cdef int size = 8192             # <<<<<<<<<<<<<<
 * 
 *             while True:
 */
  __pyx_cur_scope->__pyx_v_size = 0x2000;

  /* "netif.pyx":1116
 *             cdef int size = 8192
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 buf = <char*>realloc(buf, size)
 *                 ifbc.ifbic_len = size
 */
  while (1) {

    /* "netif.pyx":1117
 * 
 *             while True:
 *                 buf = <char*>realloc(buf, size)             # <<<<<<<<<<<<<<
 *                 ifbc.ifbic_len = size
 *                 ifbc.ifbic_buf = <defs.caddr_t>buf
 */
    __pyx_cur_scope->__pyx_v_buf = ((char *)realloc(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_size));

    /* "netif.pyx":1118
 *             while True:
 *                 buf = <char*>realloc(buf, size)
 *                 ifbc.ifbic_len = size             # <<<<<<<<<<<<<<
 *                 ifbc.ifbic_buf = <defs.caddr_t>buf
 * 
 */
    __pyx_cur_scope->__pyx_v_ifbc.ifbic_len = __pyx_cur_scope->__pyx_v_size;

    /* "netif.pyx":1119
 *                 buf = <char*>realloc(buf, size)
 *                 ifbc.ifbic_len = size
 *                 ifbc.ifbic_buf = <defs.caddr_t>buf             # <<<<<<<<<<<<<<
 * 
 *                 self.bridge_cmd(defs.BRDGGIFS, &ifbc, cython.sizeof(ifbc), False)
 */
    __pyx_cur_scope->__pyx_v_ifbc.ifbic_buf = ((caddr_t)__pyx_cur_scope->__pyx_v_buf);

    /* "netif.pyx":1121
 *                 ifbc.ifbic_buf = <defs.caddr_t>buf
 * 
 *                 self.bridge_cmd(defs.BRDGGIFS, &ifbc, cython.sizeof(ifbc), False)             # <<<<<<<<<<<<<<
 * 
 *                 if (ifbc.ifbic_len + cython.sizeof(ifbr)) < size:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(BRDGGIFS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_BridgeInterface *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->bridge_cmd(__pyx_cur_scope->__pyx_v_self, __pyx_t_1, (&__pyx_cur_scope->__pyx_v_ifbc), (sizeof(__pyx_cur_scope->__pyx_v_ifbc)), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "netif.pyx":1123
 *                 self.bridge_cmd(defs.BRDGGIFS, &ifbc, cython.sizeof(ifbc), False)
 * 
 *                 if (ifbc.ifbic_len + cython.sizeof(ifbr)) < size:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
    __pyx_t_3 = (((__pyx_cur_scope->__pyx_v_ifbc.ifbic_len + (sizeof(__pyx_cur_scope->__pyx_v_ifbr))) < __pyx_cur_scope->__pyx_v_size) != 0);
    if (__pyx_t_3) {

      /* "netif.pyx":1124
 * 
 *                 if (ifbc.ifbic_len + cython.sizeof(ifbr)) < size:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 size *= 2
 */
      goto __pyx_L5_break;

      /* "netif.pyx":1123
 *                 self.bridge_cmd(defs.BRDGGIFS, &ifbc, cython.sizeof(ifbc), False)
 * 
 *                 if (ifbc.ifbic_len + cython.sizeof(ifbr)) < size:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
    }

    /* "netif.pyx":1126
 *                     break
 * 
 *                 size *= 2             # <<<<<<<<<<<<<<
 * 
 *             for i in range(0, ifbc.ifbic_len / cython.sizeof(defs.ifbreq)):
 */
    __pyx_cur_scope->__pyx_v_size = (__pyx_cur_scope->__pyx_v_size * 2);
  }
  __pyx_L5_break:;

  /* "netif.pyx":1128
 *                 size *= 2
 * 
 *             for i in range(0, ifbc.ifbic_len / cython.sizeof(defs.ifbreq)):             # <<<<<<<<<<<<<<
 *                 ifbr = &ifbc.ifbic_req[i]
 *                 yield ifbr.ifbr_ifsname.decode('ascii')
 */
  __pyx_t_4 = (sizeof(struct ifbreq));
  if (unlikely(__pyx_t_4 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 1128, __pyx_L1_error)
  }
  __pyx_t_5 = (__pyx_cur_scope->__pyx_v_ifbc.ifbic_len / __pyx_t_4);
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_4;

    /* "netif.pyx":1129
 * 
 *             for i in range(0, ifbc.ifbic_len / cython.sizeof(defs.ifbreq)):
 *                 ifbr = &ifbc.ifbic_req[i]             # <<<<<<<<<<<<<<
 *                 yield ifbr.ifbr_ifsname.decode('ascii')
 * 
 */
    __pyx_cur_scope->__pyx_v_ifbr = (&(__pyx_cur_scope->__pyx_v_ifbc.ifbic_req[__pyx_cur_scope->__pyx_v_i]));

    /* "netif.pyx":1130
 *             for i in range(0, ifbc.ifbic_len / cython.sizeof(defs.ifbreq)):
 *                 ifbr = &ifbc.ifbic_req[i]
 *                 yield ifbr.ifbr_ifsname.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __pyx_cur_scope->__pyx_v_ifbr->ifbr_ifsname;
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_6, 0, strlen(__pyx_t_6), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L9_resume_from_yield:;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1130, __pyx_L1_error)
  }

  /* "netif.pyx":1110
 * 
 *     property members:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef defs.ifbreq* ifbr = NULL
 *             cdef defs.ifbifconf ifbc
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1134
 * 
 * cdef class VlanInterface(NetworkInterface):
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(VlanInterface, self).__getstate__()
 *         state.update({
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13VlanInterface_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_13VlanInterface_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13VlanInterface___getstate__(((struct __pyx_obj_5netif_VlanInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13VlanInterface___getstate__(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1135
 * cdef class VlanInterface(NetworkInterface):
 *     def __getstate__(self):
 *         state = super(VlanInterface, self).__getstate__()             # <<<<<<<<<<<<<<
 *         state.update({
 *             'parent': self.parent,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_VlanInterface));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_VlanInterface));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_VlanInterface));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1136
 *     def __getstate__(self):
 *         state = super(VlanInterface, self).__getstate__()
 *         state.update({             # <<<<<<<<<<<<<<
 *             'parent': self.parent,
 *             'tag': self.tag
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1137
 *         state = super(VlanInterface, self).__getstate__()
 *         state.update({
 *             'parent': self.parent,             # <<<<<<<<<<<<<<
 *             'tag': self.tag
 *         })
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_parent, __pyx_t_4) < 0) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1138
 *         state.update({
 *             'parent': self.parent,
 *             'tag': self.tag             # <<<<<<<<<<<<<<
 *         })
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tag, __pyx_t_4) < 0) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1141
 *         })
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     cdef get_vlan(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1134
 * 
 * cdef class VlanInterface(NetworkInterface):
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(VlanInterface, self).__getstate__()
 *         state.update({
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.VlanInterface.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1143
 *         return state
 * 
 *     cdef get_vlan(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef defs.vlanreq vlr
 */

static PyObject *__pyx_f_5netif_13VlanInterface_get_vlan(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  struct vlanreq __pyx_v_vlr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("get_vlan", 0);

  /* "netif.pyx":1147
 *         cdef defs.vlanreq vlr
 * 
 *         memset(&vlr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 */
  memset((&__pyx_v_vlr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":1148
 * 
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1148, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":1149
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCGETVLAN, <void*>&ifr) == -1:
 */
  __pyx_v_ifr.ifr_ifru.ifru_data = ((caddr_t)(&__pyx_v_vlr));

  /* "netif.pyx":1151
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 *         if self.ioctl(defs.SIOCGETVLAN, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_VlanInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCGETVLAN, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":1152
 * 
 *         if self.ioctl(defs.SIOCGETVLAN, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *         return vlr.vlr_parent.decode('ascii'), vlr.vlr_tag
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1152, __pyx_L1_error)

    /* "netif.pyx":1151
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 *         if self.ioctl(defs.SIOCGETVLAN, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1154
 *             raise OSError(errno, os.strerror(errno))
 * 
 *         return vlr.vlr_parent.decode('ascii'), vlr.vlr_tag             # <<<<<<<<<<<<<<
 * 
 *     def configure(self, parent, tag):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __pyx_v_vlr.vlr_parent;
  __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyInt_From_u_short(__pyx_v_vlr.vlr_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1143
 *         return state
 * 
 *     cdef get_vlan(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef defs.vlanreq vlr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.VlanInterface.get_vlan", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1156
 *         return vlr.vlr_parent.decode('ascii'), vlr.vlr_tag
 * 
 *     def configure(self, parent, tag):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef defs.vlanreq vlr
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13VlanInterface_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5netif_13VlanInterface_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_tag = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("configure (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parent,&__pyx_n_s_tag,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("configure", 1, 2, 2, 1); __PYX_ERR(0, 1156, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) __PYX_ERR(0, 1156, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_parent = values[0];
    __pyx_v_tag = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("configure", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1156, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.VlanInterface.configure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_13VlanInterface_2configure(((struct __pyx_obj_5netif_VlanInterface *)__pyx_v_self), __pyx_v_parent, __pyx_v_tag);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13VlanInterface_2configure(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_tag) {
  struct ifreq __pyx_v_ifr;
  struct vlanreq __pyx_v_vlr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  u_short __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("configure", 0);

  /* "netif.pyx":1160
 *         cdef defs.vlanreq vlr
 * 
 *         memset(&vlr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, parent.encode('ascii'))
 */
  memset((&__pyx_v_vlr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":1161
 * 
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *         strcpy(vlr.vlr_parent, parent.encode('ascii'))
 *         vlr.vlr_tag = tag
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1161, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":1162
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, parent.encode('ascii'))             # <<<<<<<<<<<<<<
 *         vlr.vlr_tag = tag
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L1_error)
  strcpy(__pyx_v_vlr.vlr_parent, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":1163
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, parent.encode('ascii'))
 *         vlr.vlr_tag = tag             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_u_short(__pyx_v_tag); if (unlikely((__pyx_t_4 == (u_short)-1) && PyErr_Occurred())) __PYX_ERR(0, 1163, __pyx_L1_error)
  __pyx_v_vlr.vlr_tag = __pyx_t_4;

  /* "netif.pyx":1164
 *         strcpy(vlr.vlr_parent, parent.encode('ascii'))
 *         vlr.vlr_tag = tag
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:
 */
  __pyx_v_ifr.ifr_ifru.ifru_data = ((caddr_t)(&__pyx_v_vlr));

  /* "netif.pyx":1166
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_5 = ((((struct __pyx_vtabstruct_5netif_VlanInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCSETVLAN, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_5) {

    /* "netif.pyx":1167
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     def unconfigure(self):
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1167, __pyx_L1_error)

    /* "netif.pyx":1166
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1156
 *         return vlr.vlr_parent.decode('ascii'), vlr.vlr_tag
 * 
 *     def configure(self, parent, tag):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef defs.vlanreq vlr
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.VlanInterface.configure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1169
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def unconfigure(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef defs.vlanreq vlr
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13VlanInterface_5unconfigure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_13VlanInterface_5unconfigure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unconfigure (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13VlanInterface_4unconfigure(((struct __pyx_obj_5netif_VlanInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13VlanInterface_4unconfigure(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self) {
  struct ifreq __pyx_v_ifr;
  struct vlanreq __pyx_v_vlr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("unconfigure", 0);

  /* "netif.pyx":1173
 *         cdef defs.vlanreq vlr
 * 
 *         memset(&vlr, 0, cython.sizeof(ifr))             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, '\0')
 */
  memset((&__pyx_v_vlr), 0, (sizeof(__pyx_v_ifr)));

  /* "netif.pyx":1174
 * 
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)             # <<<<<<<<<<<<<<
 *         strcpy(vlr.vlr_parent, '\0')
 *         vlr.vlr_tag = 0
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.nameb); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L1_error)
  strcpy(__pyx_v_ifr.ifr_name, __pyx_t_1);

  /* "netif.pyx":1175
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, '\0')             # <<<<<<<<<<<<<<
 *         vlr.vlr_tag = 0
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 */
  strcpy(__pyx_v_vlr.vlr_parent, ((char const *)"\000"));

  /* "netif.pyx":1176
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, '\0')
 *         vlr.vlr_tag = 0             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 */
  __pyx_v_vlr.vlr_tag = 0;

  /* "netif.pyx":1177
 *         strcpy(vlr.vlr_parent, '\0')
 *         vlr.vlr_tag = 0
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr             # <<<<<<<<<<<<<<
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:
 */
  __pyx_v_ifr.ifr_ifru.ifru_data = ((caddr_t)(&__pyx_v_vlr));

  /* "netif.pyx":1179
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_2 = ((((struct __pyx_vtabstruct_5netif_VlanInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ioctl(((struct __pyx_obj_5netif_NetworkInterface *)__pyx_v_self), SIOCSETVLAN, ((void *)(&__pyx_v_ifr)), NULL) == -1L) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":1180
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     property parent:
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1180, __pyx_L1_error)

    /* "netif.pyx":1179
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 * 
 *         if self.ioctl(defs.SIOCSETVLAN, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":1169
 *             raise OSError(errno, os.strerror(errno))
 * 
 *     def unconfigure(self):             # <<<<<<<<<<<<<<
 *         cdef defs.ifreq ifr
 *         cdef defs.vlanreq vlr
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.VlanInterface.unconfigure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1183
 * 
 *     property parent:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.get_vlan()[0] or None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13VlanInterface_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13VlanInterface_6parent_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13VlanInterface_6parent___get__(((struct __pyx_obj_5netif_VlanInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13VlanInterface_6parent___get__(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1184
 *     property parent:
 *         def __get__(self):
 *             return self.get_vlan()[0] or None             # <<<<<<<<<<<<<<
 * 
 *     property tag:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_VlanInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_vlan(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1184, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(Py_None);
  __pyx_t_1 = Py_None;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1183
 * 
 *     property parent:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.get_vlan()[0] or None
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.VlanInterface.parent.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1187
 * 
 *     property tag:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.get_vlan()[1] or None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13VlanInterface_3tag_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13VlanInterface_3tag_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13VlanInterface_3tag___get__(((struct __pyx_obj_5netif_VlanInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13VlanInterface_3tag___get__(struct __pyx_obj_5netif_VlanInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1188
 *     property tag:
 *         def __get__(self):
 *             return self.get_vlan()[1] or None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_VlanInterface *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_vlan(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1188, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(Py_None);
  __pyx_t_1 = Py_None;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1187
 * 
 *     property tag:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.get_vlan()[1] or None
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.VlanInterface.tag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1197
 *     cdef defs.rt_msghdr *rt_msg
 * 
 *     def __init__(self, data=None):             # <<<<<<<<<<<<<<
 *         if data:
 *             self.data = data
 */

/* Python wrapper */
static int __pyx_pw_5netif_13RoutingPacket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5netif_13RoutingPacket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingPacket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_13RoutingPacket___init__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self), __pyx_v_data);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_13RoutingPacket___init__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, PyObject *__pyx_v_data) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  char *__pyx_t_3;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1198
 * 
 *     def __init__(self, data=None):
 *         if data:             # <<<<<<<<<<<<<<
 *             self.data = data
 *             self.bufsize = len(data)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1198, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "netif.pyx":1199
 *     def __init__(self, data=None):
 *         if data:
 *             self.data = data             # <<<<<<<<<<<<<<
 *             self.bufsize = len(data)
 *             self.buffer = <char*>data
 */
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __Pyx_GOTREF(__pyx_v_self->data);
    __Pyx_DECREF(__pyx_v_self->data);
    __pyx_v_self->data = __pyx_v_data;

    /* "netif.pyx":1200
 *         if data:
 *             self.data = data
 *             self.bufsize = len(data)             # <<<<<<<<<<<<<<
 *             self.buffer = <char*>data
 * 
 */
    __pyx_t_2 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1200, __pyx_L1_error)
    __pyx_v_self->bufsize = __pyx_t_2;

    /* "netif.pyx":1201
 *             self.data = data
 *             self.bufsize = len(data)
 *             self.buffer = <char*>data             # <<<<<<<<<<<<<<
 * 
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 */
    __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error)
    __pyx_v_self->buffer = ((char *)__pyx_t_3);

    /* "netif.pyx":1198
 * 
 *     def __init__(self, data=None):
 *         if data:             # <<<<<<<<<<<<<<
 *             self.data = data
 *             self.bufsize = len(data)
 */
  }

  /* "netif.pyx":1203
 *             self.buffer = <char*>data
 * 
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_v_self->rt_msg = ((struct rt_msghdr *)__pyx_v_self->buffer);

  /* "netif.pyx":1197
 *     cdef defs.rt_msghdr *rt_msg
 * 
 *     def __init__(self, data=None):             # <<<<<<<<<<<<<<
 *         if data:
 *             self.data = data
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingPacket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1205
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'type': self.type.name,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingPacket_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_13RoutingPacket_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingPacket_2__getstate__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingPacket_2__getstate__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1206
 * 
 *     def __getstate__(self):
 *         return {             # <<<<<<<<<<<<<<
 *             'type': self.type.name,
 *             'version': self.version,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":1207
 *     def __getstate__(self):
 *         return {
 *             'type': self.type.name,             # <<<<<<<<<<<<<<
 *             'version': self.version,
 *             'length': self.length
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_3) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":1208
 *         return {
 *             'type': self.type.name,
 *             'version': self.version,             # <<<<<<<<<<<<<<
 *             'length': self.length
 *         }
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_version, __pyx_t_3) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":1209
 *             'type': self.type.name,
 *             'version': self.version,
 *             'length': self.length             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_length, __pyx_t_3) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1205
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'type': self.type.name,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingPacket.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1212
 *         }
 * 
 *     cdef _grow(self, amount):             # <<<<<<<<<<<<<<
 *         self.bufsize += amount
 *         self.buffer = <char*>realloc(self.buffer, self.bufsize)
 */

static PyObject *__pyx_f_5netif_13RoutingPacket__grow(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, PyObject *__pyx_v_amount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  __Pyx_RefNannySetupContext("_grow", 0);

  /* "netif.pyx":1213
 * 
 *     cdef _grow(self, amount):
 *         self.bufsize += amount             # <<<<<<<<<<<<<<
 *         self.buffer = <char*>realloc(self.buffer, self.bufsize)
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->bufsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_amount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->bufsize = __pyx_t_3;

  /* "netif.pyx":1214
 *     cdef _grow(self, amount):
 *         self.bufsize += amount
 *         self.buffer = <char*>realloc(self.buffer, self.bufsize)             # <<<<<<<<<<<<<<
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 * 
 */
  __pyx_v_self->buffer = ((char *)realloc(__pyx_v_self->buffer, __pyx_v_self->bufsize));

  /* "netif.pyx":1215
 *         self.bufsize += amount
 *         self.buffer = <char*>realloc(self.buffer, self.bufsize)
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer             # <<<<<<<<<<<<<<
 * 
 *     cdef _align_sa_len(self, int length):
 */
  __pyx_v_self->rt_msg = ((struct rt_msghdr *)__pyx_v_self->buffer);

  /* "netif.pyx":1212
 *         }
 * 
 *     cdef _grow(self, amount):             # <<<<<<<<<<<<<<
 *         self.bufsize += amount
 *         self.buffer = <char*>realloc(self.buffer, self.bufsize)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.RoutingPacket._grow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1217
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 * 
 *     cdef _align_sa_len(self, int length):             # <<<<<<<<<<<<<<
 *         return 1 + ((length - 1) | (cython.sizeof(long) - 1))
 * 
 */

static PyObject *__pyx_f_5netif_13RoutingPacket__align_sa_len(CYTHON_UNUSED struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, int __pyx_v_length) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_align_sa_len", 0);

  /* "netif.pyx":1218
 * 
 *     cdef _align_sa_len(self, int length):
 *         return 1 + ((length - 1) | (cython.sizeof(long) - 1))             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_sockaddr_dl(self, defs.sockaddr_dl* sdl):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t((1 + ((__pyx_v_length - 1) | ((sizeof(long)) - 1)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1217
 *         self.rt_msg = <defs.rt_msghdr*>self.buffer
 * 
 *     cdef _align_sa_len(self, int length):             # <<<<<<<<<<<<<<
 *         return 1 + ((length - 1) | (cython.sizeof(long) - 1))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingPacket._align_sa_len", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1220
 *         return 1 + ((length - 1) | (cython.sizeof(long) - 1))
 * 
 *     cdef _parse_sockaddr_dl(self, defs.sockaddr_dl* sdl):             # <<<<<<<<<<<<<<
 *         cdef char ifname[defs.IFNAMSIZ]
 * 
 */

static PyObject *__pyx_f_5netif_13RoutingPacket__parse_sockaddr_dl(CYTHON_UNUSED struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, struct sockaddr_dl *__pyx_v_sdl) {
  char __pyx_v_ifname[IFNAMSIZ];
  PyObject *__pyx_v_result = NULL;
  unsigned char __pyx_v_x;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  unsigned char __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_parse_sockaddr_dl", 0);

  /* "netif.pyx":1223
 *         cdef char ifname[defs.IFNAMSIZ]
 * 
 *         result = LinkAddress(sdl.sdl_data[:sdl.sdl_nlen])             # <<<<<<<<<<<<<<
 *         if not result.ifname:
 *             if defs.if_indextoname(sdl.sdl_index, ifname) != NULL:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LinkAddress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sdl->sdl_data) + 0, __pyx_v_sdl->sdl_nlen - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1224
 * 
 *         result = LinkAddress(sdl.sdl_data[:sdl.sdl_nlen])
 *         if not result.ifname:             # <<<<<<<<<<<<<<
 *             if defs.if_indextoname(sdl.sdl_index, ifname) != NULL:
 *                 result.ifname = ifname.decode('ascii')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_ifname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = ((!__pyx_t_6) != 0);
  if (__pyx_t_7) {

    /* "netif.pyx":1225
 *         result = LinkAddress(sdl.sdl_data[:sdl.sdl_nlen])
 *         if not result.ifname:
 *             if defs.if_indextoname(sdl.sdl_index, ifname) != NULL:             # <<<<<<<<<<<<<<
 *                 result.ifname = ifname.decode('ascii')
 * 
 */
    __pyx_t_7 = ((if_indextoname(__pyx_v_sdl->sdl_index, __pyx_v_ifname) != NULL) != 0);
    if (__pyx_t_7) {

      /* "netif.pyx":1226
 *         if not result.ifname:
 *             if defs.if_indextoname(sdl.sdl_index, ifname) != NULL:
 *                 result.ifname = ifname.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *         result.address = ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])])
 */
      __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_ifname, 0, strlen(__pyx_v_ifname), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_ifname, __pyx_t_1) < 0) __PYX_ERR(0, 1226, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "netif.pyx":1225
 *         result = LinkAddress(sdl.sdl_data[:sdl.sdl_nlen])
 *         if not result.ifname:
 *             if defs.if_indextoname(sdl.sdl_index, ifname) != NULL:             # <<<<<<<<<<<<<<
 *                 result.ifname = ifname.decode('ascii')
 * 
 */
    }

    /* "netif.pyx":1224
 * 
 *         result = LinkAddress(sdl.sdl_data[:sdl.sdl_nlen])
 *         if not result.ifname:             # <<<<<<<<<<<<<<
 *             if defs.if_indextoname(sdl.sdl_index, ifname) != NULL:
 *                 result.ifname = ifname.decode('ascii')
 */
  }

  /* "netif.pyx":1228
 *                 result.ifname = ifname.decode('ascii')
 * 
 *         result.address = ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])])             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sdl->sdl_data) + __pyx_v_sdl->sdl_nlen, (__pyx_v_sdl->sdl_nlen + __pyx_v_sdl->sdl_alen) - __pyx_v_sdl->sdl_nlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_8(__pyx_t_5);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1228, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_9 = __Pyx_PyInt_As_unsigned_char(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_x = __pyx_t_9;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_02x, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_address, __pyx_t_5) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "netif.pyx":1229
 * 
 *         result.address = ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])])
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_sockaddrs(self, int start_offset, int mask):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1220
 *         return 1 + ((length - 1) | (cython.sizeof(long) - 1))
 * 
 *     cdef _parse_sockaddr_dl(self, defs.sockaddr_dl* sdl):             # <<<<<<<<<<<<<<
 *         cdef char ifname[defs.IFNAMSIZ]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("netif.RoutingPacket._parse_sockaddr_dl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1231
 *         return result
 * 
 *     cdef _parse_sockaddrs(self, int start_offset, int mask):             # <<<<<<<<<<<<<<
 *         cdef defs.sockaddr* sa
 *         cdef defs.sockaddr_in* sin
 */

static PyObject *__pyx_f_5netif_13RoutingPacket__parse_sockaddrs(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, int __pyx_v_start_offset, int __pyx_v_mask) {
  struct sockaddr *__pyx_v_sa;
  struct sockaddr_in *__pyx_v_sin;
  struct sockaddr_in6 *__pyx_v_sin6;
  char __pyx_v_netmask[16];
  PyObject *__pyx_v_addr_sa_family = NULL;
  PyObject *__pyx_v_ptr = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_i = NULL;
  struct sockaddr_dl *__pyx_v_sdl;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  long __pyx_t_15;
  long __pyx_t_16;
  long __pyx_t_17;
  __Pyx_RefNannySetupContext("_parse_sockaddrs", 0);

  /* "netif.pyx":1237
 *         cdef char netmask[16]
 * 
 *         addr_sa_family = None             # <<<<<<<<<<<<<<
 *         ptr = start_offset
 *         result = {}
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_addr_sa_family = Py_None;

  /* "netif.pyx":1238
 * 
 *         addr_sa_family = None
 *         ptr = start_offset             # <<<<<<<<<<<<<<
 *         result = {}
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ptr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1239
 *         addr_sa_family = None
 *         ptr = start_offset
 *         result = {}             # <<<<<<<<<<<<<<
 * 
 *         for i in range(0, 7):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "netif.pyx":1241
 *         result = {}
 * 
 *         for i in range(0, 7):             # <<<<<<<<<<<<<<
 *             if not mask & (1 << i):
 *                 continue
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1241, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1241, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1241, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1241, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "netif.pyx":1242
 * 
 *         for i in range(0, 7):
 *             if not mask & (1 << i):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Lshift(__pyx_int_1, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":1243
 *         for i in range(0, 7):
 *             if not mask & (1 << i):
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             sa = <defs.sockaddr*>&self.buffer[ptr]
 */
      goto __pyx_L3_continue;

      /* "netif.pyx":1242
 * 
 *         for i in range(0, 7):
 *             if not mask & (1 << i):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "netif.pyx":1245
 *                 continue
 * 
 *             sa = <defs.sockaddr*>&self.buffer[ptr]             # <<<<<<<<<<<<<<
 *             ptr += self._align_sa_len(sa.sa_len)
 * 
 */
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ptr); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
    __pyx_v_sa = ((struct sockaddr *)(&(__pyx_v_self->buffer[__pyx_t_9])));

    /* "netif.pyx":1246
 * 
 *             sa = <defs.sockaddr*>&self.buffer[ptr]
 *             ptr += self._align_sa_len(sa.sa_len)             # <<<<<<<<<<<<<<
 * 
 *             if sa.sa_family == defs.AF_INET:
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_align_sa_len(__pyx_v_self, __pyx_v_sa->sa_len); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_ptr, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_ptr, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "netif.pyx":1248
 *             ptr += self._align_sa_len(sa.sa_len)
 * 
 *             if sa.sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *                 addr_sa_family = sa.sa_family
 *                 sin = <defs.sockaddr_in*>sa
 */
    __pyx_t_8 = ((__pyx_v_sa->sa_family == AF_INET) != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":1249
 * 
 *             if sa.sa_family == defs.AF_INET:
 *                 addr_sa_family = sa.sa_family             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>sa
 *                 result[i] = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      __pyx_t_5 = __Pyx_PyInt_From_sa_family_t(__pyx_v_sa->sa_family); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_addr_sa_family, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "netif.pyx":1250
 *             if sa.sa_family == defs.AF_INET:
 *                 addr_sa_family = sa.sa_family
 *                 sin = <defs.sockaddr_in*>sa             # <<<<<<<<<<<<<<
 *                 result[i] = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 */
      __pyx_v_sin = ((struct sockaddr_in *)__pyx_v_sa);

      /* "netif.pyx":1251
 *                 addr_sa_family = sa.sa_family
 *                 sin = <defs.sockaddr_in*>sa
 *                 result[i] = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))             # <<<<<<<<<<<<<<
 * 
 *             elif sa.sa_family == defs.AF_INET6:
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_sin->sin_addr.s_addr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_5) < 0)) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "netif.pyx":1248
 *             ptr += self._align_sa_len(sa.sa_len)
 * 
 *             if sa.sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *                 addr_sa_family = sa.sa_family
 *                 sin = <defs.sockaddr_in*>sa
 */
      goto __pyx_L6;
    }

    /* "netif.pyx":1253
 *                 result[i] = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             elif sa.sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *                 addr_sa_family = sa.sa_family
 *                 sin6 = <defs.sockaddr_in6*>sa
 */
    __pyx_t_8 = ((__pyx_v_sa->sa_family == AF_INET6) != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":1254
 * 
 *             elif sa.sa_family == defs.AF_INET6:
 *                 addr_sa_family = sa.sa_family             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>sa
 *                 result[i] = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      __pyx_t_5 = __Pyx_PyInt_From_sa_family_t(__pyx_v_sa->sa_family); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_addr_sa_family, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "netif.pyx":1255
 *             elif sa.sa_family == defs.AF_INET6:
 *                 addr_sa_family = sa.sa_family
 *                 sin6 = <defs.sockaddr_in6*>sa             # <<<<<<<<<<<<<<
 *                 result[i] = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 */
      __pyx_v_sin6 = ((struct sockaddr_in6 *)__pyx_v_sa);

      /* "netif.pyx":1256
 *                 addr_sa_family = sa.sa_family
 *                 sin6 = <defs.sockaddr_in6*>sa
 *                 result[i] = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])             # <<<<<<<<<<<<<<
 * 
 *             elif sa.sa_family == defs.AF_LINK:
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sin6->sin6_addr.s6_addr) + 0, 16 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1256, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_5) < 0)) __PYX_ERR(0, 1256, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "netif.pyx":1253
 *                 result[i] = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             elif sa.sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *                 addr_sa_family = sa.sa_family
 *                 sin6 = <defs.sockaddr_in6*>sa
 */
      goto __pyx_L6;
    }

    /* "netif.pyx":1258
 *                 result[i] = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             elif sa.sa_family == defs.AF_LINK:             # <<<<<<<<<<<<<<
 *                 sdl = <defs.sockaddr_dl*>sa
 *                 result[i] = self._parse_sockaddr_dl(sdl)
 */
    __pyx_t_8 = ((__pyx_v_sa->sa_family == AF_LINK) != 0);
    if (__pyx_t_8) {

      /* "netif.pyx":1259
 * 
 *             elif sa.sa_family == defs.AF_LINK:
 *                 sdl = <defs.sockaddr_dl*>sa             # <<<<<<<<<<<<<<
 *                 result[i] = self._parse_sockaddr_dl(sdl)
 * 
 */
      __pyx_v_sdl = ((struct sockaddr_dl *)__pyx_v_sa);

      /* "netif.pyx":1260
 *             elif sa.sa_family == defs.AF_LINK:
 *                 sdl = <defs.sockaddr_dl*>sa
 *                 result[i] = self._parse_sockaddr_dl(sdl)             # <<<<<<<<<<<<<<
 * 
 *             elif sa.sa_family in (0x00, 0xff) and i == defs.RTAX_NETMASK:
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_parse_sockaddr_dl(__pyx_v_self, __pyx_v_sdl); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_5) < 0)) __PYX_ERR(0, 1260, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "netif.pyx":1258
 *                 result[i] = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             elif sa.sa_family == defs.AF_LINK:             # <<<<<<<<<<<<<<
 *                 sdl = <defs.sockaddr_dl*>sa
 *                 result[i] = self._parse_sockaddr_dl(sdl)
 */
      goto __pyx_L6;
    }

    /* "netif.pyx":1262
 *                 result[i] = self._parse_sockaddr_dl(sdl)
 * 
 *             elif sa.sa_family in (0x00, 0xff) and i == defs.RTAX_NETMASK:             # <<<<<<<<<<<<<<
 *                 # Hack for getting netmask information when parsing route messages
 *                 # obtained via sysctl(3). I don't know why netmask sockaddrs are malformed.
 */
    switch (__pyx_v_sa->sa_family) {
      case 0x00:
      case 0xff:
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    __pyx_t_14 = (__pyx_t_7 != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_8 = __pyx_t_14;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyInt_From_int(RTAX_NETMASK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_13 = PyObject_RichCompare(__pyx_v_i, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_8 = __pyx_t_14;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_8) {

      /* "netif.pyx":1265
 *                 # Hack for getting netmask information when parsing route messages
 *                 # obtained via sysctl(3). I don't know why netmask sockaddrs are malformed.
 *                 if sa.sa_len == 0:             # <<<<<<<<<<<<<<
 *                     # default route
 *                     if addr_sa_family == defs.AF_INET:
 */
      __pyx_t_8 = ((__pyx_v_sa->sa_len == 0) != 0);
      if (__pyx_t_8) {

        /* "netif.pyx":1267
 *                 if sa.sa_len == 0:
 *                     # default route
 *                     if addr_sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(u'0.0.0.0')
 * 
 */
        __pyx_t_13 = __Pyx_PyInt_From_int(AF_INET); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1267, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_addr_sa_family, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1267, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

          /* "netif.pyx":1268
 *                     # default route
 *                     if addr_sa_family == defs.AF_INET:
 *                         result[i] = ipaddress.ip_address(u'0.0.0.0')             # <<<<<<<<<<<<<<
 * 
 *                     if addr_sa_family == defs.AF_INET6:
 */
          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_5) < 0)) __PYX_ERR(0, 1268, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "netif.pyx":1267
 *                 if sa.sa_len == 0:
 *                     # default route
 *                     if addr_sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(u'0.0.0.0')
 * 
 */
        }

        /* "netif.pyx":1270
 *                         result[i] = ipaddress.ip_address(u'0.0.0.0')
 * 
 *                     if addr_sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(u'::')
 * 
 */
        __pyx_t_5 = __Pyx_PyInt_From_int(AF_INET6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = PyObject_RichCompare(__pyx_v_addr_sa_family, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1270, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1270, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_8) {

          /* "netif.pyx":1271
 * 
 *                     if addr_sa_family == defs.AF_INET6:
 *                         result[i] = ipaddress.ip_address(u'::')             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
          __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1271, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1271, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1271, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_13) < 0)) __PYX_ERR(0, 1271, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "netif.pyx":1270
 *                         result[i] = ipaddress.ip_address(u'0.0.0.0')
 * 
 *                     if addr_sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(u'::')
 * 
 */
        }

        /* "netif.pyx":1265
 *                 # Hack for getting netmask information when parsing route messages
 *                 # obtained via sysctl(3). I don't know why netmask sockaddrs are malformed.
 *                 if sa.sa_len == 0:             # <<<<<<<<<<<<<<
 *                     # default route
 *                     if addr_sa_family == defs.AF_INET:
 */
        goto __pyx_L9;
      }

      /* "netif.pyx":1274
 * 
 *                 else:
 *                     if addr_sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(sa.sa_data[2:6])
 * 
 */
      /*else*/ {
        __pyx_t_13 = __Pyx_PyInt_From_int(AF_INET); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_addr_sa_family, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1274, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

          /* "netif.pyx":1275
 *                 else:
 *                     if addr_sa_family == defs.AF_INET:
 *                         result[i] = ipaddress.ip_address(sa.sa_data[2:6])             # <<<<<<<<<<<<<<
 * 
 *                     if addr_sa_family == defs.AF_INET6:
 */
          __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1275, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1275, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sa->sa_data) + 2, 6 - 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1275, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
            }
          }
          if (!__pyx_t_1) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_5);
          } else {
            __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1275, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_13);
            __pyx_t_13 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_5) < 0)) __PYX_ERR(0, 1275, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "netif.pyx":1274
 * 
 *                 else:
 *                     if addr_sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(sa.sa_data[2:6])
 * 
 */
        }

        /* "netif.pyx":1277
 *                         result[i] = ipaddress.ip_address(sa.sa_data[2:6])
 * 
 *                     if addr_sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *                         sin6 = <defs.sockaddr_in6*>sa
 *                         memset(netmask, 0, sizeof(netmask))
 */
        __pyx_t_5 = __Pyx_PyInt_From_int(AF_INET6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = PyObject_RichCompare(__pyx_v_addr_sa_family, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1277, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1277, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (__pyx_t_8) {

          /* "netif.pyx":1278
 * 
 *                     if addr_sa_family == defs.AF_INET6:
 *                         sin6 = <defs.sockaddr_in6*>sa             # <<<<<<<<<<<<<<
 *                         memset(netmask, 0, sizeof(netmask))
 *                         memcpy(netmask, sin6.sin6_addr.s6_addr, min(16, sa.sa_len - 8))
 */
          __pyx_v_sin6 = ((struct sockaddr_in6 *)__pyx_v_sa);

          /* "netif.pyx":1279
 *                     if addr_sa_family == defs.AF_INET6:
 *                         sin6 = <defs.sockaddr_in6*>sa
 *                         memset(netmask, 0, sizeof(netmask))             # <<<<<<<<<<<<<<
 *                         memcpy(netmask, sin6.sin6_addr.s6_addr, min(16, sa.sa_len - 8))
 *                         result[i] = ipaddress.ip_address(netmask[:16])
 */
          memset(__pyx_v_netmask, 0, (sizeof(__pyx_v_netmask)));

          /* "netif.pyx":1280
 *                         sin6 = <defs.sockaddr_in6*>sa
 *                         memset(netmask, 0, sizeof(netmask))
 *                         memcpy(netmask, sin6.sin6_addr.s6_addr, min(16, sa.sa_len - 8))             # <<<<<<<<<<<<<<
 *                         result[i] = ipaddress.ip_address(netmask[:16])
 * 
 */
          __pyx_t_15 = (__pyx_v_sa->sa_len - 8);
          __pyx_t_16 = 16;
          if (((__pyx_t_15 < __pyx_t_16) != 0)) {
            __pyx_t_17 = __pyx_t_15;
          } else {
            __pyx_t_17 = __pyx_t_16;
          }
          memcpy(__pyx_v_netmask, __pyx_v_sin6->sin6_addr.s6_addr, __pyx_t_17);

          /* "netif.pyx":1281
 *                         memset(netmask, 0, sizeof(netmask))
 *                         memcpy(netmask, sin6.sin6_addr.s6_addr, min(16, sa.sa_len - 8))
 *                         result[i] = ipaddress.ip_address(netmask[:16])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_netmask) + 0, 16 - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_13 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          if (!__pyx_t_13) {
            __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1281, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_11);
          } else {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13); __pyx_t_13 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1281, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_i, __pyx_t_11) < 0)) __PYX_ERR(0, 1281, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "netif.pyx":1277
 *                         result[i] = ipaddress.ip_address(sa.sa_data[2:6])
 * 
 *                     if addr_sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *                         sin6 = <defs.sockaddr_in6*>sa
 *                         memset(netmask, 0, sizeof(netmask))
 */
        }
      }
      __pyx_L9:;

      /* "netif.pyx":1262
 *                 result[i] = self._parse_sockaddr_dl(sdl)
 * 
 *             elif sa.sa_family in (0x00, 0xff) and i == defs.RTAX_NETMASK:             # <<<<<<<<<<<<<<
 *                 # Hack for getting netmask information when parsing route messages
 *                 # obtained via sysctl(3). I don't know why netmask sockaddrs are malformed.
 */
    }
    __pyx_L6:;

    /* "netif.pyx":1241
 *         result = {}
 * 
 *         for i in range(0, 7):             # <<<<<<<<<<<<<<
 *             if not mask & (1 << i):
 *                 continue
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1283
 *                         result[i] = ipaddress.ip_address(netmask[:16])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef _pack_sockaddrs(self, int start_offset, addrs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1231
 *         return result
 * 
 *     cdef _parse_sockaddrs(self, int start_offset, int mask):             # <<<<<<<<<<<<<<
 *         cdef defs.sockaddr* sa
 *         cdef defs.sockaddr_in* sin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("netif.RoutingPacket._parse_sockaddrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_addr_sa_family);
  __Pyx_XDECREF(__pyx_v_ptr);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1285
 *         return result
 * 
 *     cdef _pack_sockaddrs(self, int start_offset, addrs):             # <<<<<<<<<<<<<<
 *         cdef defs.sockaddr_dl* sdl
 *         cdef defs.sockaddr_in* sin
 */

static PyObject *__pyx_f_5netif_13RoutingPacket__pack_sockaddrs(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, int __pyx_v_start_offset, PyObject *__pyx_v_addrs) {
  struct sockaddr_dl *__pyx_v_sdl;
  struct sockaddr_in *__pyx_v_sin;
  struct sockaddr_in6 *__pyx_v_sin6;
  int __pyx_v_ptr;
  int __pyx_v_mask;
  PyObject *__pyx_v_rtax = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_sa_size = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  size_t __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  uint32_t __pyx_t_15;
  char *__pyx_t_16;
  __Pyx_RefNannySetupContext("_pack_sockaddrs", 0);

  /* "netif.pyx":1292
 *         cdef int mask
 * 
 *         mask = 0             # <<<<<<<<<<<<<<
 *         ptr = start_offset
 * 
 */
  __pyx_v_mask = 0;

  /* "netif.pyx":1293
 * 
 *         mask = 0
 *         ptr = start_offset             # <<<<<<<<<<<<<<
 * 
 *         for rtax, i in addrs.items():
 */
  __pyx_v_ptr = __pyx_v_start_offset;

  /* "netif.pyx":1295
 *         ptr = start_offset
 * 
 *         for rtax, i in addrs.items():             # <<<<<<<<<<<<<<
 *             if not i:
 *                 continue
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_addrs, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1295, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1295, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1295, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1295, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_rtax, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "netif.pyx":1296
 * 
 *         for rtax, i in addrs.items():
 *             if not i:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_i); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __pyx_t_10 = ((!__pyx_t_9) != 0);
    if (__pyx_t_10) {

      /* "netif.pyx":1297
 *         for rtax, i in addrs.items():
 *             if not i:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             mask |= (1 << rtax)
 */
      goto __pyx_L3_continue;

      /* "netif.pyx":1296
 * 
 *         for rtax, i in addrs.items():
 *             if not i:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "netif.pyx":1299
 *                 continue
 * 
 *             mask |= (1 << rtax)             # <<<<<<<<<<<<<<
 * 
 *             if type(i) is LinkAddress:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Lshift(__pyx_int_1, __pyx_v_rtax); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_mask = __pyx_t_11;

    /* "netif.pyx":1301
 *             mask |= (1 << rtax)
 * 
 *             if type(i) is LinkAddress:             # <<<<<<<<<<<<<<
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_dl))
 *                 self._grow(sa_size)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LinkAddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = (((PyObject *)Py_TYPE(__pyx_v_i)) == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = (__pyx_t_10 != 0);
    if (__pyx_t_9) {

      /* "netif.pyx":1302
 * 
 *             if type(i) is LinkAddress:
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_dl))             # <<<<<<<<<<<<<<
 *                 self._grow(sa_size)
 *                 sdl = <defs.sockaddr_dl*>&self.buffer[ptr]
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_align_sa_len(__pyx_v_self, (sizeof(struct sockaddr_dl))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_sa_size, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "netif.pyx":1303
 *             if type(i) is LinkAddress:
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_dl))
 *                 self._grow(sa_size)             # <<<<<<<<<<<<<<
 *                 sdl = <defs.sockaddr_dl*>&self.buffer[ptr]
 *                 memset(sdl, 0, sa_size)
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_grow(__pyx_v_self, __pyx_v_sa_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "netif.pyx":1304
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_dl))
 *                 self._grow(sa_size)
 *                 sdl = <defs.sockaddr_dl*>&self.buffer[ptr]             # <<<<<<<<<<<<<<
 *                 memset(sdl, 0, sa_size)
 *                 sdl.sdl_family = defs.AF_LINK
 */
      __pyx_v_sdl = ((struct sockaddr_dl *)(&(__pyx_v_self->buffer[__pyx_v_ptr])));

      /* "netif.pyx":1305
 *                 self._grow(sa_size)
 *                 sdl = <defs.sockaddr_dl*>&self.buffer[ptr]
 *                 memset(sdl, 0, sa_size)             # <<<<<<<<<<<<<<
 *                 sdl.sdl_family = defs.AF_LINK
 *                 sdl.sdl_len = cython.sizeof(defs.sockaddr_dl)
 */
      __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_v_sa_size); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L1_error)
      memset(__pyx_v_sdl, 0, __pyx_t_12);

      /* "netif.pyx":1306
 *                 sdl = <defs.sockaddr_dl*>&self.buffer[ptr]
 *                 memset(sdl, 0, sa_size)
 *                 sdl.sdl_family = defs.AF_LINK             # <<<<<<<<<<<<<<
 *                 sdl.sdl_len = cython.sizeof(defs.sockaddr_dl)
 *                 sdl.sdl_index = defs.if_nametoindex(i.ifname)
 */
      __pyx_v_sdl->sdl_family = AF_LINK;

      /* "netif.pyx":1307
 *                 memset(sdl, 0, sa_size)
 *                 sdl.sdl_family = defs.AF_LINK
 *                 sdl.sdl_len = cython.sizeof(defs.sockaddr_dl)             # <<<<<<<<<<<<<<
 *                 sdl.sdl_index = defs.if_nametoindex(i.ifname)
 *                 ptr += sa_size
 */
      __pyx_v_sdl->sdl_len = (sizeof(struct sockaddr_dl));

      /* "netif.pyx":1308
 *                 sdl.sdl_family = defs.AF_LINK
 *                 sdl.sdl_len = cython.sizeof(defs.sockaddr_dl)
 *                 sdl.sdl_index = defs.if_nametoindex(i.ifname)             # <<<<<<<<<<<<<<
 *                 ptr += sa_size
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_ifname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 1308, __pyx_L1_error)
      __pyx_v_sdl->sdl_index = if_nametoindex(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "netif.pyx":1309
 *                 sdl.sdl_len = cython.sizeof(defs.sockaddr_dl)
 *                 sdl.sdl_index = defs.if_nametoindex(i.ifname)
 *                 ptr += sa_size             # <<<<<<<<<<<<<<
 * 
 *             elif i.version == 4:
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_sa_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_ptr = __pyx_t_11;

      /* "netif.pyx":1301
 *             mask |= (1 << rtax)
 * 
 *             if type(i) is LinkAddress:             # <<<<<<<<<<<<<<
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_dl))
 *                 self._grow(sa_size)
 */
      goto __pyx_L8;
    }

    /* "netif.pyx":1311
 *                 ptr += sa_size
 * 
 *             elif i.version == 4:             # <<<<<<<<<<<<<<
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in))
 *                 self._grow(sa_size)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_version); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {

      /* "netif.pyx":1312
 * 
 *             elif i.version == 4:
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in))             # <<<<<<<<<<<<<<
 *                 self._grow(sa_size)
 *                 sin = <defs.sockaddr_in*>&self.buffer[ptr]
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_align_sa_len(__pyx_v_self, (sizeof(struct sockaddr_in))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_sa_size, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "netif.pyx":1313
 *             elif i.version == 4:
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in))
 *                 self._grow(sa_size)             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>&self.buffer[ptr]
 *                 memset(sin, 0, sa_size)
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_grow(__pyx_v_self, __pyx_v_sa_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "netif.pyx":1314
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in))
 *                 self._grow(sa_size)
 *                 sin = <defs.sockaddr_in*>&self.buffer[ptr]             # <<<<<<<<<<<<<<
 *                 memset(sin, 0, sa_size)
 *                 sin.sin_family = defs.AF_INET
 */
      __pyx_v_sin = ((struct sockaddr_in *)(&(__pyx_v_self->buffer[__pyx_v_ptr])));

      /* "netif.pyx":1315
 *                 self._grow(sa_size)
 *                 sin = <defs.sockaddr_in*>&self.buffer[ptr]
 *                 memset(sin, 0, sa_size)             # <<<<<<<<<<<<<<
 *                 sin.sin_family = defs.AF_INET
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 */
      __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_v_sa_size); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1315, __pyx_L1_error)
      memset(__pyx_v_sin, 0, __pyx_t_12);

      /* "netif.pyx":1316
 *                 sin = <defs.sockaddr_in*>&self.buffer[ptr]
 *                 memset(sin, 0, sa_size)
 *                 sin.sin_family = defs.AF_INET             # <<<<<<<<<<<<<<
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *                 sin.sin_addr.s_addr = socket.htonl(int(i))
 */
      __pyx_v_sin->sin_family = AF_INET;

      /* "netif.pyx":1317
 *                 memset(sin, 0, sa_size)
 *                 sin.sin_family = defs.AF_INET
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)             # <<<<<<<<<<<<<<
 *                 sin.sin_addr.s_addr = socket.htonl(int(i))
 *                 ptr += sa_size
 */
      __pyx_v_sin->sin_len = (sizeof(struct sockaddr_in));

      /* "netif.pyx":1318
 *                 sin.sin_family = defs.AF_INET
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *                 sin.sin_addr.s_addr = socket.htonl(int(i))             # <<<<<<<<<<<<<<
 *                 ptr += sa_size
 * 
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_htonl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_15 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_sin->sin_addr.s_addr = __pyx_t_15;

      /* "netif.pyx":1319
 *                 sin.sin_len = cython.sizeof(defs.sockaddr_in)
 *                 sin.sin_addr.s_addr = socket.htonl(int(i))
 *                 ptr += sa_size             # <<<<<<<<<<<<<<
 * 
 *             elif i.version == 6:
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_sa_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ptr = __pyx_t_11;

      /* "netif.pyx":1311
 *                 ptr += sa_size
 * 
 *             elif i.version == 4:             # <<<<<<<<<<<<<<
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in))
 *                 self._grow(sa_size)
 */
      goto __pyx_L8;
    }

    /* "netif.pyx":1321
 *                 ptr += sa_size
 * 
 *             elif i.version == 6:             # <<<<<<<<<<<<<<
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in6))
 *                 self._grow(sa_size)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {

      /* "netif.pyx":1322
 * 
 *             elif i.version == 6:
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in6))             # <<<<<<<<<<<<<<
 *                 self._grow(sa_size)
 *                 sin6 = <defs.sockaddr_in6*>&self.buffer[ptr]
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_align_sa_len(__pyx_v_self, (sizeof(struct sockaddr_in6))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_sa_size, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "netif.pyx":1323
 *             elif i.version == 6:
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in6))
 *                 self._grow(sa_size)             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>&self.buffer[ptr]
 *                 memset(sin6, 0, sa_size)
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingPacket *)__pyx_v_self->__pyx_vtab)->_grow(__pyx_v_self, __pyx_v_sa_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "netif.pyx":1324
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in6))
 *                 self._grow(sa_size)
 *                 sin6 = <defs.sockaddr_in6*>&self.buffer[ptr]             # <<<<<<<<<<<<<<
 *                 memset(sin6, 0, sa_size)
 *                 sin6.sin6_family = defs.AF_INET6
 */
      __pyx_v_sin6 = ((struct sockaddr_in6 *)(&(__pyx_v_self->buffer[__pyx_v_ptr])));

      /* "netif.pyx":1325
 *                 self._grow(sa_size)
 *                 sin6 = <defs.sockaddr_in6*>&self.buffer[ptr]
 *                 memset(sin6, 0, sa_size)             # <<<<<<<<<<<<<<
 *                 sin6.sin6_family = defs.AF_INET6
 *                 sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 */
      __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_v_sa_size); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1325, __pyx_L1_error)
      memset(__pyx_v_sin6, 0, __pyx_t_12);

      /* "netif.pyx":1326
 *                 sin6 = <defs.sockaddr_in6*>&self.buffer[ptr]
 *                 memset(sin6, 0, sa_size)
 *                 sin6.sin6_family = defs.AF_INET6             # <<<<<<<<<<<<<<
 *                 sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *                 memcpy(&sin6.sin6_addr, <char*>i.packed, 16)
 */
      __pyx_v_sin6->sin6_family = AF_INET6;

      /* "netif.pyx":1327
 *                 memset(sin6, 0, sa_size)
 *                 sin6.sin6_family = defs.AF_INET6
 *                 sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)             # <<<<<<<<<<<<<<
 *                 memcpy(&sin6.sin6_addr, <char*>i.packed, 16)
 *                 ptr += sa_size
 */
      __pyx_v_sin6->sin6_len = (sizeof(struct sockaddr_in6));

      /* "netif.pyx":1328
 *                 sin6.sin6_family = defs.AF_INET6
 *                 sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *                 memcpy(&sin6.sin6_addr, <char*>i.packed, 16)             # <<<<<<<<<<<<<<
 *                 ptr += sa_size
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_packed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 1328, __pyx_L1_error)
      memcpy((&__pyx_v_sin6->sin6_addr), ((char *)__pyx_t_16), 16);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "netif.pyx":1329
 *                 sin6.sin6_len = cython.sizeof(defs.sockaddr_in6)
 *                 memcpy(&sin6.sin6_addr, <char*>i.packed, 16)
 *                 ptr += sa_size             # <<<<<<<<<<<<<<
 * 
 *         return mask
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_sa_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1329, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ptr = __pyx_t_11;

      /* "netif.pyx":1321
 *                 ptr += sa_size
 * 
 *             elif i.version == 6:             # <<<<<<<<<<<<<<
 *                 sa_size = self._align_sa_len(sizeof(defs.sockaddr_in6))
 *                 self._grow(sa_size)
 */
    }
    __pyx_L8:;

    /* "netif.pyx":1295
 *         ptr = start_offset
 * 
 *         for rtax, i in addrs.items():             # <<<<<<<<<<<<<<
 *             if not i:
 *                 continue
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1331
 *                 ptr += sa_size
 * 
 *         return mask             # <<<<<<<<<<<<<<
 * 
 *     property type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1285
 *         return result
 * 
 *     cdef _pack_sockaddrs(self, int start_offset, addrs):             # <<<<<<<<<<<<<<
 *         cdef defs.sockaddr_dl* sdl
 *         cdef defs.sockaddr_in* sin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("netif.RoutingPacket._pack_sockaddrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rtax);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_sa_size);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1334
 * 
 *     property type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return RoutingMessageType(self.rt_msg.rtm_type)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingPacket_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13RoutingPacket_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingPacket_4type___get__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingPacket_4type___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1335
 *     property type:
 *         def __get__(self):
 *             return RoutingMessageType(self.rt_msg.rtm_type)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_u_char(__pyx_v_self->rt_msg->rtm_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1334
 * 
 *     property type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return RoutingMessageType(self.rt_msg.rtm_type)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingPacket.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1337
 *             return RoutingMessageType(self.rt_msg.rtm_type)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.rt_msg.rtm_type = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_13RoutingPacket_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_13RoutingPacket_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingPacket_4type_2__set__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_13RoutingPacket_4type_2__set__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  u_char __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1338
 * 
 *         def __set__(self, value):
 *             self.rt_msg.rtm_type = value             # <<<<<<<<<<<<<<
 * 
 *     property version:
 */
  __pyx_t_1 = __Pyx_PyInt_As_u_char(__pyx_v_value); if (unlikely((__pyx_t_1 == (u_char)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L1_error)
  __pyx_v_self->rt_msg->rtm_type = __pyx_t_1;

  /* "netif.pyx":1337
 *             return RoutingMessageType(self.rt_msg.rtm_type)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.rt_msg.rtm_type = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingPacket.type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1341
 * 
 *     property version:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.rt_msg.rtm_version
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingPacket_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13RoutingPacket_7version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingPacket_7version___get__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingPacket_7version___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1342
 *     property version:
 *         def __get__(self):
 *             return self.rt_msg.rtm_version             # <<<<<<<<<<<<<<
 * 
 *     property length:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_u_char(__pyx_v_self->rt_msg->rtm_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1341
 * 
 *     property version:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.rt_msg.rtm_version
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingPacket.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1345
 * 
 *     property length:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.rt_msg.rtm_msglen
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingPacket_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13RoutingPacket_6length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingPacket_6length___get__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingPacket_6length___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1346
 *     property length:
 *         def __get__(self):
 *             return self.rt_msg.rtm_msglen             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_u_short(__pyx_v_self->rt_msg->rtm_msglen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1345
 * 
 *     property length:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.rt_msg.rtm_msglen
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingPacket.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1192
 * 
 * cdef class RoutingPacket(object):
 *     cdef readonly object data             # <<<<<<<<<<<<<<
 *     cdef char *buffer
 *     cdef size_t bufsize
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingPacket_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_13RoutingPacket_4data_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingPacket_4data___get__(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingPacket_4data___get__(struct __pyx_obj_5netif_RoutingPacket *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->data);
  __pyx_r = __pyx_v_self->data;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1352
 *     cdef defs.if_announcemsghdr* header
 * 
 *     def __init__(self, packet):             # <<<<<<<<<<<<<<
 *         super(InterfaceAnnounceMessage, self).__init__(packet)
 *         self.header = <defs.if_announcemsghdr*>self.buffer
 */

/* Python wrapper */
static int __pyx_pw_5netif_24InterfaceAnnounceMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5netif_24InterfaceAnnounceMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_packet = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packet,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packet)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1352, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_packet = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1352, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.InterfaceAnnounceMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_24InterfaceAnnounceMessage___init__(((struct __pyx_obj_5netif_InterfaceAnnounceMessage *)__pyx_v_self), __pyx_v_packet);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_24InterfaceAnnounceMessage___init__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self, PyObject *__pyx_v_packet) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1353
 * 
 *     def __init__(self, packet):
 *         super(InterfaceAnnounceMessage, self).__init__(packet)             # <<<<<<<<<<<<<<
 *         self.header = <defs.if_announcemsghdr*>self.buffer
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_packet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_packet);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1354
 *     def __init__(self, packet):
 *         super(InterfaceAnnounceMessage, self).__init__(packet)
 *         self.header = <defs.if_announcemsghdr*>self.buffer             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_v_self->header = ((struct if_announcemsghdr *)__pyx_v_self->__pyx_base.buffer);

  /* "netif.pyx":1352
 *     cdef defs.if_announcemsghdr* header
 * 
 *     def __init__(self, packet):             # <<<<<<<<<<<<<<
 *         super(InterfaceAnnounceMessage, self).__init__(packet)
 *         self.header = <defs.if_announcemsghdr*>self.buffer
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.InterfaceAnnounceMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1356
 *         self.header = <defs.if_announcemsghdr*>self.buffer
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(InterfaceAnnounceMessage, self).__getstate__()
 *         state.update({
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_24InterfaceAnnounceMessage_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_24InterfaceAnnounceMessage_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_24InterfaceAnnounceMessage_2__getstate__(((struct __pyx_obj_5netif_InterfaceAnnounceMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_24InterfaceAnnounceMessage_2__getstate__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1357
 * 
 *     def __getstate__(self):
 *         state = super(InterfaceAnnounceMessage, self).__getstate__()             # <<<<<<<<<<<<<<
 *         state.update({
 *             'interface': self.interface,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1358
 *     def __getstate__(self):
 *         state = super(InterfaceAnnounceMessage, self).__getstate__()
 *         state.update({             # <<<<<<<<<<<<<<
 *             'interface': self.interface,
 *             'type': self.type
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1359
 *         state = super(InterfaceAnnounceMessage, self).__getstate__()
 *         state.update({
 *             'interface': self.interface,             # <<<<<<<<<<<<<<
 *             'type': self.type
 *         })
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interface, __pyx_t_4) < 0) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1360
 *         state.update({
 *             'interface': self.interface,
 *             'type': self.type             # <<<<<<<<<<<<<<
 *         })
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_t_4) < 0) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1363
 *         })
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     property interface:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1356
 *         self.header = <defs.if_announcemsghdr*>self.buffer
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(InterfaceAnnounceMessage, self).__getstate__()
 *         state.update({
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.InterfaceAnnounceMessage.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1366
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.header.ifan_name.decode('ascii')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_24InterfaceAnnounceMessage_9interface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_24InterfaceAnnounceMessage_9interface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_24InterfaceAnnounceMessage_9interface___get__(((struct __pyx_obj_5netif_InterfaceAnnounceMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_24InterfaceAnnounceMessage_9interface___get__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1367
 *     property interface:
 *         def __get__(self):
 *             return self.header.ifan_name.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *     property type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->header->ifan_name;
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1366
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.header.ifan_name.decode('ascii')
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.InterfaceAnnounceMessage.interface.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1370
 * 
 *     property type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return InterfaceAnnounceType(self.header.ifan_what)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_24InterfaceAnnounceMessage_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_24InterfaceAnnounceMessage_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_24InterfaceAnnounceMessage_4type___get__(((struct __pyx_obj_5netif_InterfaceAnnounceMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_24InterfaceAnnounceMessage_4type___get__(struct __pyx_obj_5netif_InterfaceAnnounceMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1371
 *     property type:
 *         def __get__(self):
 *             return InterfaceAnnounceType(self.header.ifan_what)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceAnnounceType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_u_short(__pyx_v_self->header->ifan_what); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1370
 * 
 *     property type:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return InterfaceAnnounceType(self.header.ifan_what)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.InterfaceAnnounceMessage.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1379
 *     cdef int addrs_mask
 * 
 *     def __init__(self, packet):             # <<<<<<<<<<<<<<
 *         super(InterfaceInfoMessage, self).__init__(packet)
 *         self.header = <defs.if_msghdr*>self.buffer
 */

/* Python wrapper */
static int __pyx_pw_5netif_20InterfaceInfoMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5netif_20InterfaceInfoMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_packet = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packet,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packet)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1379, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_packet = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1379, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage___init__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self), __pyx_v_packet);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_20InterfaceInfoMessage___init__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self, PyObject *__pyx_v_packet) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1380
 * 
 *     def __init__(self, packet):
 *         super(InterfaceInfoMessage, self).__init__(packet)             # <<<<<<<<<<<<<<
 *         self.header = <defs.if_msghdr*>self.buffer
 *         self.addrs_mask = self.header.ifm_addrs
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_packet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_packet);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1381
 *     def __init__(self, packet):
 *         super(InterfaceInfoMessage, self).__init__(packet)
 *         self.header = <defs.if_msghdr*>self.buffer             # <<<<<<<<<<<<<<
 *         self.addrs_mask = self.header.ifm_addrs
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.if_msghdr), self.addrs_mask)
 */
  __pyx_v_self->header = ((struct if_msghdr *)__pyx_v_self->__pyx_base.buffer);

  /* "netif.pyx":1382
 *         super(InterfaceInfoMessage, self).__init__(packet)
 *         self.header = <defs.if_msghdr*>self.buffer
 *         self.addrs_mask = self.header.ifm_addrs             # <<<<<<<<<<<<<<
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.if_msghdr), self.addrs_mask)
 * 
 */
  __pyx_t_5 = __pyx_v_self->header->ifm_addrs;
  __pyx_v_self->addrs_mask = __pyx_t_5;

  /* "netif.pyx":1383
 *         self.header = <defs.if_msghdr*>self.buffer
 *         self.addrs_mask = self.header.ifm_addrs
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.if_msghdr), self.addrs_mask)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5netif_InterfaceInfoMessage *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._parse_sockaddrs(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self), (sizeof(struct if_msghdr)), __pyx_v_self->addrs_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->addrs);
  __Pyx_DECREF(__pyx_v_self->addrs);
  __pyx_v_self->addrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1379
 *     cdef int addrs_mask
 * 
 *     def __init__(self, packet):             # <<<<<<<<<<<<<<
 *         super(InterfaceInfoMessage, self).__init__(packet)
 *         self.header = <defs.if_msghdr*>self.buffer
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1385
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.if_msghdr), self.addrs_mask)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(InterfaceInfoMessage, self).__getstate__()
 *         state.update({
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage_2__getstate__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_2__getstate__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1386
 * 
 *     def __getstate__(self):
 *         state = super(InterfaceInfoMessage, self).__getstate__()             # <<<<<<<<<<<<<<
 *         state.update({
 *             'flags': self.flags,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1387
 *     def __getstate__(self):
 *         state = super(InterfaceInfoMessage, self).__getstate__()
 *         state.update({             # <<<<<<<<<<<<<<
 *             'flags': self.flags,
 *             'interface': self.interface,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1388
 *         state = super(InterfaceInfoMessage, self).__getstate__()
 *         state.update({
 *             'flags': self.flags,             # <<<<<<<<<<<<<<
 *             'interface': self.interface,
 *             'link-state': self.link_state
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_flags, __pyx_t_4) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1389
 *         state.update({
 *             'flags': self.flags,
 *             'interface': self.interface,             # <<<<<<<<<<<<<<
 *             'link-state': self.link_state
 *         })
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interface, __pyx_t_4) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1390
 *             'flags': self.flags,
 *             'interface': self.interface,
 *             'link-state': self.link_state             # <<<<<<<<<<<<<<
 *         })
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_link_state_2, __pyx_t_4) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1393
 *         })
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     property flags:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1385
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.if_msghdr), self.addrs_mask)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(InterfaceInfoMessage, self).__getstate__()
 *         state.update({
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1396
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.header.ifm_flags, InterfaceFlags)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_5flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_5flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage_5flags___get__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_5flags___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1397
 *     property flags:
 *         def __get__(self):
 *             return bitmask_to_set(self.header.ifm_flags, InterfaceFlags)             # <<<<<<<<<<<<<<
 * 
 *     property link_state:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->header->ifm_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceFlags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1396
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.header.ifm_flags, InterfaceFlags)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1400
 * 
 *     property link_state:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return InterfaceLinkState(self.header.ifm_data.ifi_link_state)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_10link_state_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_10link_state_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage_10link_state___get__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_10link_state___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1401
 *     property link_state:
 *         def __get__(self):
 *             return InterfaceLinkState(self.header.ifm_data.ifi_link_state)             # <<<<<<<<<<<<<<
 * 
 *     property mtu:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceLinkState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->header->ifm_data.ifi_link_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1400
 * 
 *     property link_state:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return InterfaceLinkState(self.header.ifm_data.ifi_link_state)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.link_state.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1404
 * 
 *     property mtu:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.header.ifm_data.ifi_mtu
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_3mtu_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_3mtu_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage_3mtu___get__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_3mtu___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1405
 *     property mtu:
 *         def __get__(self):
 *             return self.header.ifm_data.ifi_mtu             # <<<<<<<<<<<<<<
 * 
 *     property interface:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->header->ifm_data.ifi_mtu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1404
 * 
 *     property mtu:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.header.ifm_data.ifi_mtu
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.mtu.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1408
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifm_index, ifname) != NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_9interface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_9interface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage_9interface___get__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_9interface___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self) {
  char __pyx_v_ifname[IFNAMSIZ];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1410
 *         def __get__(self):
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifm_index, ifname) != NULL:             # <<<<<<<<<<<<<<
 *                 return ifname.decode('ascii')
 * 
 */
  __pyx_t_1 = ((if_indextoname(__pyx_v_self->header->ifm_index, __pyx_v_ifname) != NULL) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":1411
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifm_index, ifname) != NULL:
 *                 return ifname.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_ifname, 0, strlen(__pyx_v_ifname), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1410
 *         def __get__(self):
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifm_index, ifname) != NULL:             # <<<<<<<<<<<<<<
 *                 return ifname.decode('ascii')
 * 
 */
  }

  /* "netif.pyx":1413
 *                 return ifname.decode('ascii')
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 * cdef class InterfaceAddrMessage(RoutingPacket):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1408
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifm_index, ifname) != NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.InterfaceInfoMessage.interface.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1376
 * cdef class InterfaceInfoMessage(RoutingPacket):
 *     cdef defs.if_msghdr* header
 *     cdef readonly object addrs             # <<<<<<<<<<<<<<
 *     cdef int addrs_mask
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_5addrs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceInfoMessage_5addrs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceInfoMessage_5addrs___get__(((struct __pyx_obj_5netif_InterfaceInfoMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceInfoMessage_5addrs___get__(struct __pyx_obj_5netif_InterfaceInfoMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->addrs);
  __pyx_r = __pyx_v_self->addrs;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1420
 *     cdef int addrs_mask
 * 
 *     def __init__(self, packet):             # <<<<<<<<<<<<<<
 *         super(InterfaceAddrMessage, self).__init__(packet)
 *         self.header = <defs.ifa_msghdr*>self.buffer
 */

/* Python wrapper */
static int __pyx_pw_5netif_20InterfaceAddrMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5netif_20InterfaceAddrMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_packet = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packet,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packet)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1420, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_packet = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1420, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage___init__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self), __pyx_v_packet);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_20InterfaceAddrMessage___init__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self, PyObject *__pyx_v_packet) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1421
 * 
 *     def __init__(self, packet):
 *         super(InterfaceAddrMessage, self).__init__(packet)             # <<<<<<<<<<<<<<
 *         self.header = <defs.ifa_msghdr*>self.buffer
 *         self.addrs_mask = self.header.ifam_addrs
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_packet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_packet);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1422
 *     def __init__(self, packet):
 *         super(InterfaceAddrMessage, self).__init__(packet)
 *         self.header = <defs.ifa_msghdr*>self.buffer             # <<<<<<<<<<<<<<
 *         self.addrs_mask = self.header.ifam_addrs
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.ifa_msghdr), self.addrs_mask)
 */
  __pyx_v_self->header = ((struct ifa_msghdr *)__pyx_v_self->__pyx_base.buffer);

  /* "netif.pyx":1423
 *         super(InterfaceAddrMessage, self).__init__(packet)
 *         self.header = <defs.ifa_msghdr*>self.buffer
 *         self.addrs_mask = self.header.ifam_addrs             # <<<<<<<<<<<<<<
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.ifa_msghdr), self.addrs_mask)
 * 
 */
  __pyx_t_5 = __pyx_v_self->header->ifam_addrs;
  __pyx_v_self->addrs_mask = __pyx_t_5;

  /* "netif.pyx":1424
 *         self.header = <defs.ifa_msghdr*>self.buffer
 *         self.addrs_mask = self.header.ifam_addrs
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.ifa_msghdr), self.addrs_mask)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5netif_InterfaceAddrMessage *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._parse_sockaddrs(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self), (sizeof(struct ifa_msghdr)), __pyx_v_self->addrs_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->addrs);
  __Pyx_DECREF(__pyx_v_self->addrs);
  __pyx_v_self->addrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1420
 *     cdef int addrs_mask
 * 
 *     def __init__(self, packet):             # <<<<<<<<<<<<<<
 *         super(InterfaceAddrMessage, self).__init__(packet)
 *         self.header = <defs.ifa_msghdr*>self.buffer
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1426
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.ifa_msghdr), self.addrs_mask)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(InterfaceAddrMessage, self).__getstate__()
 *         state.update({
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_2__getstate__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_2__getstate__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1427
 * 
 *     def __getstate__(self):
 *         state = super(InterfaceAddrMessage, self).__getstate__()             # <<<<<<<<<<<<<<
 *         state.update({
 *             'flags': self.flags,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1428
 *     def __getstate__(self):
 *         state = super(InterfaceAddrMessage, self).__getstate__()
 *         state.update({             # <<<<<<<<<<<<<<
 *             'flags': self.flags,
 *             'interface': self.interface,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1429
 *         state = super(InterfaceAddrMessage, self).__getstate__()
 *         state.update({
 *             'flags': self.flags,             # <<<<<<<<<<<<<<
 *             'interface': self.interface,
 *         })
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_flags, __pyx_t_4) < 0) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1430
 *         state.update({
 *             'flags': self.flags,
 *             'interface': self.interface,             # <<<<<<<<<<<<<<
 *         })
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interface, __pyx_t_4) < 0) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1433
 *         })
 * 
 *         if self.address:             # <<<<<<<<<<<<<<
 *             state['address'] = str(self.address)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "netif.pyx":1434
 * 
 *         if self.address:
 *             state['address'] = str(self.address)             # <<<<<<<<<<<<<<
 * 
 *         if self.netmask:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_state, __pyx_n_s_address, __pyx_t_1) < 0)) __PYX_ERR(0, 1434, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":1433
 *         })
 * 
 *         if self.address:             # <<<<<<<<<<<<<<
 *             state['address'] = str(self.address)
 * 
 */
  }

  /* "netif.pyx":1436
 *             state['address'] = str(self.address)
 * 
 *         if self.netmask:             # <<<<<<<<<<<<<<
 *             state['netmask'] = str(self.netmask)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "netif.pyx":1437
 * 
 *         if self.netmask:
 *             state['netmask'] = str(self.netmask)             # <<<<<<<<<<<<<<
 * 
 *         if self.dest_address:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_state, __pyx_n_s_netmask, __pyx_t_1) < 0)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":1436
 *             state['address'] = str(self.address)
 * 
 *         if self.netmask:             # <<<<<<<<<<<<<<
 *             state['netmask'] = str(self.netmask)
 * 
 */
  }

  /* "netif.pyx":1439
 *             state['netmask'] = str(self.netmask)
 * 
 *         if self.dest_address:             # <<<<<<<<<<<<<<
 *             state['dest-address'] = str(self.dest_address)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dest_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "netif.pyx":1440
 * 
 *         if self.dest_address:
 *             state['dest-address'] = str(self.dest_address)             # <<<<<<<<<<<<<<
 * 
 *         return state
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dest_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_state, __pyx_kp_s_dest_address_2, __pyx_t_1) < 0)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":1439
 *             state['netmask'] = str(self.netmask)
 * 
 *         if self.dest_address:             # <<<<<<<<<<<<<<
 *             state['dest-address'] = str(self.dest_address)
 * 
 */
  }

  /* "netif.pyx":1442
 *             state['dest-address'] = str(self.dest_address)
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     property address:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1426
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.ifa_msghdr), self.addrs_mask)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(InterfaceAddrMessage, self).__getstate__()
 *         state.update({
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1445
 * 
 *     property address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_IFA in self.addrs:
 *                 return self.addrs[defs.RTAX_IFA]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_7address_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_7address_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_7address___get__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_7address___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1446
 *     property address:
 *         def __get__(self):
 *             if defs.RTAX_IFA in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_IFA]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(RTAX_IFA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->addrs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1447
 *         def __get__(self):
 *             if defs.RTAX_IFA in self.addrs:
 *                 return self.addrs[defs.RTAX_IFA]             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->addrs, RTAX_IFA, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1446
 *     property address:
 *         def __get__(self):
 *             if defs.RTAX_IFA in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_IFA]
 * 
 */
  }

  /* "netif.pyx":1449
 *                 return self.addrs[defs.RTAX_IFA]
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     property netmask:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1445
 * 
 *     property address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_IFA in self.addrs:
 *                 return self.addrs[defs.RTAX_IFA]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1452
 * 
 *     property netmask:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_NETMASK in self.addrs:
 *                 return self.addrs[defs.RTAX_NETMASK]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_7netmask_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_7netmask_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_7netmask___get__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_7netmask___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1453
 *     property netmask:
 *         def __get__(self):
 *             if defs.RTAX_NETMASK in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_NETMASK]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(RTAX_NETMASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->addrs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1454
 *         def __get__(self):
 *             if defs.RTAX_NETMASK in self.addrs:
 *                 return self.addrs[defs.RTAX_NETMASK]             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->addrs, RTAX_NETMASK, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1453
 *     property netmask:
 *         def __get__(self):
 *             if defs.RTAX_NETMASK in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_NETMASK]
 * 
 */
  }

  /* "netif.pyx":1456
 *                 return self.addrs[defs.RTAX_NETMASK]
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     property dest_address:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1452
 * 
 *     property netmask:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_NETMASK in self.addrs:
 *                 return self.addrs[defs.RTAX_NETMASK]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.netmask.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1459
 * 
 *     property dest_address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_BRD in self.addrs:
 *                 return self.addrs[defs.RTAX_BRD]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_12dest_address_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_12dest_address_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_12dest_address___get__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_12dest_address___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1460
 *     property dest_address:
 *         def __get__(self):
 *             if defs.RTAX_BRD in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_BRD]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(RTAX_BRD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->addrs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1461
 *         def __get__(self):
 *             if defs.RTAX_BRD in self.addrs:
 *                 return self.addrs[defs.RTAX_BRD]             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->addrs, RTAX_BRD, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1460
 *     property dest_address:
 *         def __get__(self):
 *             if defs.RTAX_BRD in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_BRD]
 * 
 */
  }

  /* "netif.pyx":1463
 *                 return self.addrs[defs.RTAX_BRD]
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     property flags:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1459
 * 
 *     property dest_address:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_BRD in self.addrs:
 *                 return self.addrs[defs.RTAX_BRD]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.dest_address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1466
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.header.ifam_flags, InterfaceFlags)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_5flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_5flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_5flags___get__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_5flags___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1467
 *     property flags:
 *         def __get__(self):
 *             return bitmask_to_set(self.header.ifam_flags, InterfaceFlags)             # <<<<<<<<<<<<<<
 * 
 *     property interface:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->header->ifam_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceFlags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1466
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.header.ifam_flags, InterfaceFlags)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1470
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifam_index, ifname) != NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_9interface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_9interface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_9interface___get__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_9interface___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  char __pyx_v_ifname[IFNAMSIZ];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1472
 *         def __get__(self):
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifam_index, ifname) != NULL:             # <<<<<<<<<<<<<<
 *                 return ifname.decode('ascii')
 * 
 */
  __pyx_t_1 = ((if_indextoname(__pyx_v_self->header->ifam_index, __pyx_v_ifname) != NULL) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":1473
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifam_index, ifname) != NULL:
 *                 return ifname.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_ifname, 0, strlen(__pyx_v_ifname), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1472
 *         def __get__(self):
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifam_index, ifname) != NULL:             # <<<<<<<<<<<<<<
 *                 return ifname.decode('ascii')
 * 
 */
  }

  /* "netif.pyx":1475
 *                 return ifname.decode('ascii')
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1470
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef char ifname[defs.IFNAMSIZ]
 *             if defs.if_indextoname(self.header.ifam_index, ifname) != NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.InterfaceAddrMessage.interface.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1417
 * cdef class InterfaceAddrMessage(RoutingPacket):
 *     cdef defs.ifa_msghdr* header
 *     cdef readonly object addrs             # <<<<<<<<<<<<<<
 *     cdef int addrs_mask
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_5addrs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_20InterfaceAddrMessage_5addrs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20InterfaceAddrMessage_5addrs___get__(((struct __pyx_obj_5netif_InterfaceAddrMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20InterfaceAddrMessage_5addrs___get__(struct __pyx_obj_5netif_InterfaceAddrMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->addrs);
  __pyx_r = __pyx_v_self->addrs;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1483
 *     cdef int free
 * 
 *     def __init__(self, packet=None):             # <<<<<<<<<<<<<<
 *         if not packet:
 *             self.free = True
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_packet = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packet,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packet);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1483, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_packet = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1483, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_14RoutingMessage___init__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), __pyx_v_packet);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage___init__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_packet) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1484
 * 
 *     def __init__(self, packet=None):
 *         if not packet:             # <<<<<<<<<<<<<<
 *             self.free = True
 *             self.bufsize = cython.sizeof(defs.rt_msghdr)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_packet); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1484, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":1485
 *     def __init__(self, packet=None):
 *         if not packet:
 *             self.free = True             # <<<<<<<<<<<<<<
 *             self.bufsize = cython.sizeof(defs.rt_msghdr)
 *             self.buffer = <char*>malloc(self.bufsize)
 */
    __pyx_v_self->free = 1;

    /* "netif.pyx":1486
 *         if not packet:
 *             self.free = True
 *             self.bufsize = cython.sizeof(defs.rt_msghdr)             # <<<<<<<<<<<<<<
 *             self.buffer = <char*>malloc(self.bufsize)
 *             memset(self.buffer, 0, self.bufsize)
 */
    __pyx_v_self->__pyx_base.bufsize = (sizeof(struct rt_msghdr));

    /* "netif.pyx":1487
 *             self.free = True
 *             self.bufsize = cython.sizeof(defs.rt_msghdr)
 *             self.buffer = <char*>malloc(self.bufsize)             # <<<<<<<<<<<<<<
 *             memset(self.buffer, 0, self.bufsize)
 *         else:
 */
    __pyx_v_self->__pyx_base.buffer = ((char *)malloc(__pyx_v_self->__pyx_base.bufsize));

    /* "netif.pyx":1488
 *             self.bufsize = cython.sizeof(defs.rt_msghdr)
 *             self.buffer = <char*>malloc(self.bufsize)
 *             memset(self.buffer, 0, self.bufsize)             # <<<<<<<<<<<<<<
 *         else:
 *             self.free = False
 */
    memset(__pyx_v_self->__pyx_base.buffer, 0, __pyx_v_self->__pyx_base.bufsize);

    /* "netif.pyx":1484
 * 
 *     def __init__(self, packet=None):
 *         if not packet:             # <<<<<<<<<<<<<<
 *             self.free = True
 *             self.bufsize = cython.sizeof(defs.rt_msghdr)
 */
    goto __pyx_L3;
  }

  /* "netif.pyx":1490
 *             memset(self.buffer, 0, self.bufsize)
 *         else:
 *             self.free = False             # <<<<<<<<<<<<<<
 * 
 *         super(RoutingMessage, self).__init__(packet)
 */
  /*else*/ {
    __pyx_v_self->free = 0;
  }
  __pyx_L3:;

  /* "netif.pyx":1492
 *             self.free = False
 * 
 *         super(RoutingMessage, self).__init__(packet)             # <<<<<<<<<<<<<<
 *         self.addrs_mask = self.rt_msg.rtm_addrs
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs_mask)
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_RoutingMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_RoutingMessage));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_5netif_RoutingMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_packet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_packet);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "netif.pyx":1493
 * 
 *         super(RoutingMessage, self).__init__(packet)
 *         self.addrs_mask = self.rt_msg.rtm_addrs             # <<<<<<<<<<<<<<
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs_mask)
 * 
 */
  __pyx_t_7 = __pyx_v_self->__pyx_base.rt_msg->rtm_addrs;
  __pyx_v_self->addrs_mask = __pyx_t_7;

  /* "netif.pyx":1494
 *         super(RoutingMessage, self).__init__(packet)
 *         self.addrs_mask = self.rt_msg.rtm_addrs
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs_mask)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5netif_RoutingMessage *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._parse_sockaddrs(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self), (sizeof(struct rt_msghdr)), __pyx_v_self->addrs_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->addrs);
  __Pyx_DECREF(__pyx_v_self->addrs);
  __pyx_v_self->addrs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "netif.pyx":1483
 *     cdef int free
 * 
 *     def __init__(self, packet=None):             # <<<<<<<<<<<<<<
 *         if not packet:
 *             self.free = True
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.RoutingMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1496
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs_mask)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.free:
 *             free(self.buffer)
 */

/* Python wrapper */
static void __pyx_pw_5netif_14RoutingMessage_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5netif_14RoutingMessage_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5netif_14RoutingMessage_2__dealloc__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5netif_14RoutingMessage_2__dealloc__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "netif.pyx":1497
 * 
 *     def __dealloc__(self):
 *         if self.free:             # <<<<<<<<<<<<<<
 *             free(self.buffer)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->free != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":1498
 *     def __dealloc__(self):
 *         if self.free:
 *             free(self.buffer)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
    free(__pyx_v_self->__pyx_base.buffer);

    /* "netif.pyx":1497
 * 
 *     def __dealloc__(self):
 *         if self.free:             # <<<<<<<<<<<<<<
 *             free(self.buffer)
 * 
 */
  }

  /* "netif.pyx":1496
 *         self.addrs = self._parse_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs_mask)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.free:
 *             free(self.buffer)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "netif.pyx":1500
 *             free(self.buffer)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(RoutingMessage, self).__getstate__()
 *         gateway = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_4__getstate__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_4__getstate__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_gateway = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1501
 * 
 *     def __getstate__(self):
 *         state = super(RoutingMessage, self).__getstate__()             # <<<<<<<<<<<<<<
 *         gateway = None
 *         if self.gateway is not None:
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_RoutingMessage));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_RoutingMessage));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5netif_RoutingMessage));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1502
 *     def __getstate__(self):
 *         state = super(RoutingMessage, self).__getstate__()
 *         gateway = None             # <<<<<<<<<<<<<<
 *         if self.gateway is not None:
 *             gateway = self.gateway.__getstate__() if type(self.gateway) is LinkAddress else str(self.gateway)
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_gateway = Py_None;

  /* "netif.pyx":1503
 *         state = super(RoutingMessage, self).__getstate__()
 *         gateway = None
 *         if self.gateway is not None:             # <<<<<<<<<<<<<<
 *             gateway = self.gateway.__getstate__() if type(self.gateway) is LinkAddress else str(self.gateway)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gateway); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "netif.pyx":1504
 *         gateway = None
 *         if self.gateway is not None:
 *             gateway = self.gateway.__getstate__() if type(self.gateway) is LinkAddress else str(self.gateway)             # <<<<<<<<<<<<<<
 * 
 *         state.update({
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gateway); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LinkAddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_t_2)) == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if ((__pyx_t_5 != 0)) {
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gateway); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getstate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gateway); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_gateway, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "netif.pyx":1503
 *         state = super(RoutingMessage, self).__getstate__()
 *         gateway = None
 *         if self.gateway is not None:             # <<<<<<<<<<<<<<
 *             gateway = self.gateway.__getstate__() if type(self.gateway) is LinkAddress else str(self.gateway)
 * 
 */
  }

  /* "netif.pyx":1506
 *             gateway = self.gateway.__getstate__() if type(self.gateway) is LinkAddress else str(self.gateway)
 * 
 *         state.update({             # <<<<<<<<<<<<<<
 *             'errno': self.errno,
 *             'flags': [x.name for x in self.flags],
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1507
 * 
 *         state.update({
 *             'errno': self.errno,             # <<<<<<<<<<<<<<
 *             'flags': [x.name for x in self.flags],
 *             'interface': self.interface,
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_errno, __pyx_t_2) < 0) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1508
 *         state.update({
 *             'errno': self.errno,
 *             'flags': [x.name for x in self.flags],             # <<<<<<<<<<<<<<
 *             'interface': self.interface,
 *             'network': str(self.network),
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1508, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1508, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1508, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_10(__pyx_t_8);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1508, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1509
 *             'errno': self.errno,
 *             'flags': [x.name for x in self.flags],
 *             'interface': self.interface,             # <<<<<<<<<<<<<<
 *             'network': str(self.network),
 *             'gateway': gateway
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_interface, __pyx_t_2) < 0) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1510
 *             'flags': [x.name for x in self.flags],
 *             'interface': self.interface,
 *             'network': str(self.network),             # <<<<<<<<<<<<<<
 *             'gateway': gateway
 *         })
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_network, __pyx_t_2) < 0) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1512
 *             'network': str(self.network),
 *             'gateway': gateway
 *         })             # <<<<<<<<<<<<<<
 * 
 *         if self.netmask:
 */
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_gateway, __pyx_v_gateway) < 0) __PYX_ERR(0, 1507, __pyx_L1_error)
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1514
 *         })
 * 
 *         if self.netmask:             # <<<<<<<<<<<<<<
 *             state['netmask'] = str(self.netmask)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "netif.pyx":1515
 * 
 *         if self.netmask:
 *             state['netmask'] = str(self.netmask)             # <<<<<<<<<<<<<<
 * 
 *         return state
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_state, __pyx_n_s_netmask, __pyx_t_1) < 0)) __PYX_ERR(0, 1515, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":1514
 *         })
 * 
 *         if self.netmask:             # <<<<<<<<<<<<<<
 *             state['netmask'] = str(self.netmask)
 * 
 */
  }

  /* "netif.pyx":1517
 *             state['netmask'] = str(self.netmask)
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "netif.pyx":1500
 *             free(self.buffer)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         state = super(RoutingMessage, self).__getstate__()
 *         gateway = None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.RoutingMessage.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_gateway);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1519
 *         return state
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         self.rt_msg.rtm_version = 5
 *         self.rt_msg.rtm_addrs = self._pack_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_7as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_7as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_6as_buffer(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_6as_buffer(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "netif.pyx":1520
 * 
 *     def as_buffer(self):
 *         self.rt_msg.rtm_version = 5             # <<<<<<<<<<<<<<
 *         self.rt_msg.rtm_addrs = self._pack_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs)
 *         self.rt_msg.rtm_msglen = self.bufsize
 */
  __pyx_v_self->__pyx_base.rt_msg->rtm_version = 5;

  /* "netif.pyx":1521
 *     def as_buffer(self):
 *         self.rt_msg.rtm_version = 5
 *         self.rt_msg.rtm_addrs = self._pack_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs)             # <<<<<<<<<<<<<<
 *         self.rt_msg.rtm_msglen = self.bufsize
 *         return self.buffer[:self.bufsize]
 */
  __pyx_t_1 = __pyx_v_self->addrs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_5netif_RoutingMessage *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._pack_sockaddrs(((struct __pyx_obj_5netif_RoutingPacket *)__pyx_v_self), (sizeof(struct rt_msghdr)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base.rt_msg->rtm_addrs = __pyx_t_3;

  /* "netif.pyx":1522
 *         self.rt_msg.rtm_version = 5
 *         self.rt_msg.rtm_addrs = self._pack_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs)
 *         self.rt_msg.rtm_msglen = self.bufsize             # <<<<<<<<<<<<<<
 *         return self.buffer[:self.bufsize]
 * 
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.bufsize;
  __pyx_v_self->__pyx_base.rt_msg->rtm_msglen = __pyx_t_4;

  /* "netif.pyx":1523
 *         self.rt_msg.rtm_addrs = self._pack_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs)
 *         self.rt_msg.rtm_msglen = self.bufsize
 *         return self.buffer[:self.bufsize]             # <<<<<<<<<<<<<<
 * 
 *     property errno:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_self->__pyx_base.buffer + 0, __pyx_v_self->__pyx_base.bufsize - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1519
 *         return state
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         self.rt_msg.rtm_version = 5
 *         self.rt_msg.rtm_addrs = self._pack_sockaddrs(cython.sizeof(defs.rt_msghdr), self.addrs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.RoutingMessage.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1526
 * 
 *     property errno:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.rt_msg.rtm_errno
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_5errno_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_5errno_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_5errno___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_5errno___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1527
 *     property errno:
 *         def __get__(self):
 *             return self.rt_msg.rtm_errno             # <<<<<<<<<<<<<<
 * 
 *     property flags:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.rt_msg->rtm_errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1526
 * 
 *     property errno:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.rt_msg.rtm_errno
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingMessage.errno.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1530
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.rt_msg.rtm_flags, RouteFlags)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_5flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_5flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_5flags___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_5flags___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1531
 *     property flags:
 *         def __get__(self):
 *             return bitmask_to_set(self.rt_msg.rtm_flags, RouteFlags)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.rt_msg->rtm_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_RouteFlags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1530
 * 
 *     property flags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return bitmask_to_set(self.rt_msg.rtm_flags, RouteFlags)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.RoutingMessage.flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1533
 *             return bitmask_to_set(self.rt_msg.rtm_flags, RouteFlags)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.rt_msg.rtm_flags = set_to_bitmask(value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_5flags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_5flags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_5flags_2__set__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage_5flags_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1534
 * 
 *         def __set__(self, value):
 *             self.rt_msg.rtm_flags = set_to_bitmask(value)             # <<<<<<<<<<<<<<
 * 
 *     property interface:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_to_bitmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_value);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base.rt_msg->rtm_flags = __pyx_t_5;

  /* "netif.pyx":1533
 *             return bitmask_to_set(self.rt_msg.rtm_flags, RouteFlags)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.rt_msg.rtm_flags = set_to_bitmask(value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.RoutingMessage.flags.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1537
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef char ifname[defs.IFNAMSIZ]
 *             cdef char* result
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_9interface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_9interface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_9interface___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_9interface___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  char __pyx_v_ifname[IFNAMSIZ];
  char *__pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1540
 *             cdef char ifname[defs.IFNAMSIZ]
 *             cdef char* result
 *             result = defs.if_indextoname(self.rt_msg.rtm_index, ifname)             # <<<<<<<<<<<<<<
 *             return result.decode('ascii') if result != NULL else None
 * 
 */
  __pyx_v_result = if_indextoname(__pyx_v_self->__pyx_base.rt_msg->rtm_index, __pyx_v_ifname);

  /* "netif.pyx":1541
 *             cdef char* result
 *             result = defs.if_indextoname(self.rt_msg.rtm_index, ifname)
 *             return result.decode('ascii') if result != NULL else None             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_result != NULL) != 0)) {
    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_result, 0, strlen(__pyx_v_result), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1537
 * 
 *     property interface:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef char ifname[defs.IFNAMSIZ]
 *             cdef char* result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.RoutingMessage.interface.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1543
 *             return result.decode('ascii') if result != NULL else None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.rt_msg.rtm_index = defs.if_nametoindex(value.encode('ascii'))
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_9interface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_9interface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_9interface_2__set__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage_9interface_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1544
 * 
 *         def __set__(self, value):
 *             self.rt_msg.rtm_index = defs.if_nametoindex(value.encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *     property network:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 1544, __pyx_L1_error)
  __pyx_v_self->__pyx_base.rt_msg->rtm_index = if_nametoindex(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1543
 *             return result.decode('ascii') if result != NULL else None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.rt_msg.rtm_index = defs.if_nametoindex(value.encode('ascii'))
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.RoutingMessage.interface.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1547
 * 
 *     property network:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_DST in self.addrs:
 *                 return self.addrs[defs.RTAX_DST]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_7network_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_7network_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_7network___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_7network___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1548
 *     property network:
 *         def __get__(self):
 *             if defs.RTAX_DST in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_DST]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(RTAX_DST); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->addrs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1549
 *         def __get__(self):
 *             if defs.RTAX_DST in self.addrs:
 *                 return self.addrs[defs.RTAX_DST]             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->addrs, RTAX_DST, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1548
 *     property network:
 *         def __get__(self):
 *             if defs.RTAX_DST in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_DST]
 * 
 */
  }

  /* "netif.pyx":1551
 *                 return self.addrs[defs.RTAX_DST]
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1547
 * 
 *     property network:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_DST in self.addrs:
 *                 return self.addrs[defs.RTAX_DST]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingMessage.network.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1553
 *             return None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.addrs[defs.RTAX_DST] = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_7network_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_7network_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_7network_2__set__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage_7network_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1554
 * 
 *         def __set__(self, value):
 *             self.addrs[defs.RTAX_DST] = value             # <<<<<<<<<<<<<<
 * 
 *     property netmask:
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v_self->addrs, RTAX_DST, __pyx_v_value, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 1554, __pyx_L1_error)

  /* "netif.pyx":1553
 *             return None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.addrs[defs.RTAX_DST] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingMessage.network.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1557
 * 
 *     property netmask:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_NETMASK in self.addrs:
 *                 return self.addrs[defs.RTAX_NETMASK]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_7netmask_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_7netmask_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_7netmask___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_7netmask___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1558
 *     property netmask:
 *         def __get__(self):
 *             if defs.RTAX_NETMASK in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_NETMASK]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(RTAX_NETMASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->addrs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1559
 *         def __get__(self):
 *             if defs.RTAX_NETMASK in self.addrs:
 *                 return self.addrs[defs.RTAX_NETMASK]             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->addrs, RTAX_NETMASK, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1558
 *     property netmask:
 *         def __get__(self):
 *             if defs.RTAX_NETMASK in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_NETMASK]
 * 
 */
  }

  /* "netif.pyx":1561
 *                 return self.addrs[defs.RTAX_NETMASK]
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1557
 * 
 *     property netmask:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_NETMASK in self.addrs:
 *                 return self.addrs[defs.RTAX_NETMASK]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingMessage.netmask.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1563
 *             return None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.addrs[defs.RTAX_NETMASK] = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_7netmask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_7netmask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_7netmask_2__set__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage_7netmask_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1564
 * 
 *         def __set__(self, value):
 *             self.addrs[defs.RTAX_NETMASK] = value             # <<<<<<<<<<<<<<
 * 
 *     property gateway:
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v_self->addrs, RTAX_NETMASK, __pyx_v_value, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 1564, __pyx_L1_error)

  /* "netif.pyx":1563
 *             return None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.addrs[defs.RTAX_NETMASK] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingMessage.netmask.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1567
 * 
 *     property gateway:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_GATEWAY in self.addrs:
 *                 return self.addrs[defs.RTAX_GATEWAY]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_7gateway_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_7gateway_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_7gateway___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_7gateway___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1568
 *     property gateway:
 *         def __get__(self):
 *             if defs.RTAX_GATEWAY in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_GATEWAY]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(RTAX_GATEWAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->addrs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1569
 *         def __get__(self):
 *             if defs.RTAX_GATEWAY in self.addrs:
 *                 return self.addrs[defs.RTAX_GATEWAY]             # <<<<<<<<<<<<<<
 * 
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->addrs, RTAX_GATEWAY, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1568
 *     property gateway:
 *         def __get__(self):
 *             if defs.RTAX_GATEWAY in self.addrs:             # <<<<<<<<<<<<<<
 *                 return self.addrs[defs.RTAX_GATEWAY]
 * 
 */
  }

  /* "netif.pyx":1571
 *                 return self.addrs[defs.RTAX_GATEWAY]
 * 
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1567
 * 
 *     property gateway:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if defs.RTAX_GATEWAY in self.addrs:
 *                 return self.addrs[defs.RTAX_GATEWAY]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.RoutingMessage.gateway.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1573
 *             return None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.addrs[defs.RTAX_GATEWAY] = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_7gateway_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_7gateway_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_7gateway_2__set__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage_7gateway_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1574
 * 
 *         def __set__(self, value):
 *             self.addrs[defs.RTAX_GATEWAY] = value             # <<<<<<<<<<<<<<
 * 
 *     property route:
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v_self->addrs, RTAX_GATEWAY, __pyx_v_value, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 1574, __pyx_L1_error)

  /* "netif.pyx":1573
 *             return None
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.addrs[defs.RTAX_GATEWAY] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingMessage.gateway.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1577
 * 
 *     property route:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             result = Route(
 *                 self.network,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_5route_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_5route_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_5route___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_5route___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "netif.pyx":1578
 *     property route:
 *         def __get__(self):
 *             result = Route(             # <<<<<<<<<<<<<<
 *                 self.network,
 *                 self.netmask,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Route); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1579
 *         def __get__(self):
 *             result = Route(
 *                 self.network,             # <<<<<<<<<<<<<<
 *                 self.netmask,
 *                 self.gateway,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_network); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1580
 *             result = Route(
 *                 self.network,
 *                 self.netmask,             # <<<<<<<<<<<<<<
 *                 self.gateway,
 *                 self.interface
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_netmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1581
 *                 self.network,
 *                 self.netmask,
 *                 self.gateway,             # <<<<<<<<<<<<<<
 *                 self.interface
 *             )
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gateway); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "netif.pyx":1582
 *                 self.netmask,
 *                 self.gateway,
 *                 self.interface             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interface); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_7) {
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1585
 *             )
 * 
 *             result.flags = self.flags             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_flags, __pyx_t_1) < 0) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1586
 * 
 *             result.flags = self.flags
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, route):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1577
 * 
 *     property route:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             result = Route(
 *                 self.network,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.RoutingMessage.route.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1588
 *             return result
 * 
 *         def __set__(self, route):             # <<<<<<<<<<<<<<
 *             self.network = route.network
 *             self.netmask = route.netmask
 */

/* Python wrapper */
static int __pyx_pw_5netif_14RoutingMessage_5route_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_route); /*proto*/
static int __pyx_pw_5netif_14RoutingMessage_5route_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_route) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_5route_2__set__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self), ((PyObject *)__pyx_v_route));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5netif_14RoutingMessage_5route_2__set__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self, PyObject *__pyx_v_route) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "netif.pyx":1589
 * 
 *         def __set__(self, route):
 *             self.network = route.network             # <<<<<<<<<<<<<<
 *             self.netmask = route.netmask
 *             self.gateway = route.gateway
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_route, __pyx_n_s_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_network, __pyx_t_1) < 0) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1590
 *         def __set__(self, route):
 *             self.network = route.network
 *             self.netmask = route.netmask             # <<<<<<<<<<<<<<
 *             self.gateway = route.gateway
 *             self.flags = route.flags & {RouteFlags.STATIC, RouteFlags.GATEWAY, RouteFlags.HOST}
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_route, __pyx_n_s_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_netmask, __pyx_t_1) < 0) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1591
 *             self.network = route.network
 *             self.netmask = route.netmask
 *             self.gateway = route.gateway             # <<<<<<<<<<<<<<
 *             self.flags = route.flags & {RouteFlags.STATIC, RouteFlags.GATEWAY, RouteFlags.HOST}
 *             if route.interface:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_route, __pyx_n_s_gateway); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gateway, __pyx_t_1) < 0) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1592
 *             self.netmask = route.netmask
 *             self.gateway = route.gateway
 *             self.flags = route.flags & {RouteFlags.STATIC, RouteFlags.GATEWAY, RouteFlags.HOST}             # <<<<<<<<<<<<<<
 *             if route.interface:
 *                 self.interface = route.interface
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_route, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RouteFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_STATIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RouteFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GATEWAY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RouteFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_HOST); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PySet_Add(__pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PySet_Add(__pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PySet_Add(__pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags, __pyx_t_5) < 0) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "netif.pyx":1593
 *             self.gateway = route.gateway
 *             self.flags = route.flags & {RouteFlags.STATIC, RouteFlags.GATEWAY, RouteFlags.HOST}
 *             if route.interface:             # <<<<<<<<<<<<<<
 *                 self.interface = route.interface
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_route, __pyx_n_s_interface); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {

    /* "netif.pyx":1594
 *             self.flags = route.flags & {RouteFlags.STATIC, RouteFlags.GATEWAY, RouteFlags.HOST}
 *             if route.interface:
 *                 self.interface = route.interface             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_route, __pyx_n_s_interface); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interface, __pyx_t_5) < 0) __PYX_ERR(0, 1594, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "netif.pyx":1593
 *             self.gateway = route.gateway
 *             self.flags = route.flags & {RouteFlags.STATIC, RouteFlags.GATEWAY, RouteFlags.HOST}
 *             if route.interface:             # <<<<<<<<<<<<<<
 *                 self.interface = route.interface
 * 
 */
  }

  /* "netif.pyx":1588
 *             return result
 * 
 *         def __set__(self, route):             # <<<<<<<<<<<<<<
 *             self.network = route.network
 *             self.netmask = route.netmask
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingMessage.route.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1479
 * 
 * cdef class RoutingMessage(RoutingPacket):
 *     cdef readonly object addrs             # <<<<<<<<<<<<<<
 *     cdef int addrs_mask
 *     cdef int free
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_14RoutingMessage_5addrs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5netif_14RoutingMessage_5addrs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14RoutingMessage_5addrs___get__(((struct __pyx_obj_5netif_RoutingMessage *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14RoutingMessage_5addrs___get__(struct __pyx_obj_5netif_RoutingMessage *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->addrs);
  __pyx_r = __pyx_v_self->addrs;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1598
 * 
 * class Route(object):
 *     def __init__(self, network, netmask, gateway=None, interface=None):             # <<<<<<<<<<<<<<
 *         self.network = ipaddress.ip_address(network)
 *         self.netmask = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5Route_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5Route_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5netif_5Route_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_5Route_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_network = 0;
  PyObject *__pyx_v_netmask = 0;
  PyObject *__pyx_v_gateway = 0;
  PyObject *__pyx_v_interface = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_network,&__pyx_n_s_netmask,&__pyx_n_s_gateway,&__pyx_n_s_interface,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_network)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 1598, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_netmask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 1598, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gateway);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interface);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1598, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_network = values[1];
    __pyx_v_netmask = values[2];
    __pyx_v_gateway = values[3];
    __pyx_v_interface = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1598, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.Route.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_5Route___init__(__pyx_self, __pyx_v_self, __pyx_v_network, __pyx_v_netmask, __pyx_v_gateway, __pyx_v_interface);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_5Route___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_network, PyObject *__pyx_v_netmask, PyObject *__pyx_v_gateway, PyObject *__pyx_v_interface) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1599
 * class Route(object):
 *     def __init__(self, network, netmask, gateway=None, interface=None):
 *         self.network = ipaddress.ip_address(network)             # <<<<<<<<<<<<<<
 *         self.netmask = None
 *         self.gateway = None
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_network);
    __Pyx_GIVEREF(__pyx_v_network);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_network);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_network, __pyx_t_1) < 0) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1600
 *     def __init__(self, network, netmask, gateway=None, interface=None):
 *         self.network = ipaddress.ip_address(network)
 *         self.netmask = None             # <<<<<<<<<<<<<<
 *         self.gateway = None
 *         self.interface = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_netmask, Py_None) < 0) __PYX_ERR(0, 1600, __pyx_L1_error)

  /* "netif.pyx":1601
 *         self.network = ipaddress.ip_address(network)
 *         self.netmask = None
 *         self.gateway = None             # <<<<<<<<<<<<<<
 *         self.interface = None
 *         self.flags = set()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_gateway, Py_None) < 0) __PYX_ERR(0, 1601, __pyx_L1_error)

  /* "netif.pyx":1602
 *         self.netmask = None
 *         self.gateway = None
 *         self.interface = None             # <<<<<<<<<<<<<<
 *         self.flags = set()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_interface, Py_None) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)

  /* "netif.pyx":1603
 *         self.gateway = None
 *         self.interface = None
 *         self.flags = set()             # <<<<<<<<<<<<<<
 * 
 *         if netmask:
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_flags, __pyx_t_1) < 0) __PYX_ERR(0, 1603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1605
 *         self.flags = set()
 * 
 *         if netmask:             # <<<<<<<<<<<<<<
 *             self.netmask = ipaddress.ip_address(netmask)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_netmask); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1605, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "netif.pyx":1606
 * 
 *         if netmask:
 *             self.netmask = ipaddress.ip_address(netmask)             # <<<<<<<<<<<<<<
 * 
 *         if gateway:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_netmask); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_netmask);
      __Pyx_GIVEREF(__pyx_v_netmask);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_netmask);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_netmask, __pyx_t_1) < 0) __PYX_ERR(0, 1606, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":1605
 *         self.flags = set()
 * 
 *         if netmask:             # <<<<<<<<<<<<<<
 *             self.netmask = ipaddress.ip_address(netmask)
 * 
 */
  }

  /* "netif.pyx":1608
 *             self.netmask = ipaddress.ip_address(netmask)
 * 
 *         if gateway:             # <<<<<<<<<<<<<<
 *             if type(gateway) is LinkAddress:
 *                 self.gateway = gateway.ifname
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_gateway); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1608, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "netif.pyx":1609
 * 
 *         if gateway:
 *             if type(gateway) is LinkAddress:             # <<<<<<<<<<<<<<
 *                 self.gateway = gateway.ifname
 *             else:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LinkAddress); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_gateway)) == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "netif.pyx":1610
 *         if gateway:
 *             if type(gateway) is LinkAddress:
 *                 self.gateway = gateway.ifname             # <<<<<<<<<<<<<<
 *             else:
 *                 self.gateway = ipaddress.ip_address(gateway)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gateway, __pyx_n_s_ifname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_gateway, __pyx_t_1) < 0) __PYX_ERR(0, 1610, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "netif.pyx":1609
 * 
 *         if gateway:
 *             if type(gateway) is LinkAddress:             # <<<<<<<<<<<<<<
 *                 self.gateway = gateway.ifname
 *             else:
 */
      goto __pyx_L5;
    }

    /* "netif.pyx":1612
 *                 self.gateway = gateway.ifname
 *             else:
 *                 self.gateway = ipaddress.ip_address(gateway)             # <<<<<<<<<<<<<<
 * 
 *         if interface:
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_gateway); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_gateway);
        __Pyx_GIVEREF(__pyx_v_gateway);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_gateway);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_gateway, __pyx_t_1) < 0) __PYX_ERR(0, 1612, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "netif.pyx":1608
 *             self.netmask = ipaddress.ip_address(netmask)
 * 
 *         if gateway:             # <<<<<<<<<<<<<<
 *             if type(gateway) is LinkAddress:
 *                 self.gateway = gateway.ifname
 */
  }

  /* "netif.pyx":1614
 *                 self.gateway = ipaddress.ip_address(gateway)
 * 
 *         if interface:             # <<<<<<<<<<<<<<
 *             self.interface = interface
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_interface); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1614, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "netif.pyx":1615
 * 
 *         if interface:
 *             self.interface = interface             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_interface, __pyx_v_interface) < 0) __PYX_ERR(0, 1615, __pyx_L1_error)

    /* "netif.pyx":1614
 *                 self.gateway = ipaddress.ip_address(gateway)
 * 
 *         if interface:             # <<<<<<<<<<<<<<
 *             self.interface = interface
 * 
 */
  }

  /* "netif.pyx":1598
 * 
 * class Route(object):
 *     def __init__(self, network, netmask, gateway=None, interface=None):             # <<<<<<<<<<<<<<
 *         self.network = ipaddress.ip_address(network)
 *         self.netmask = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.Route.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1618
 * 
 *     @property
 *     def af(self):             # <<<<<<<<<<<<<<
 *         if not self.network:
 *             return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5Route_3af(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5Route_3af = {"af", (PyCFunction)__pyx_pw_5netif_5Route_3af, METH_O, 0};
static PyObject *__pyx_pw_5netif_5Route_3af(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("af (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_5Route_2af(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_5Route_2af(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("af", 0);

  /* "netif.pyx":1619
 *     @property
 *     def af(self):
 *         if not self.network:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1620
 *     def af(self):
 *         if not self.network:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         if self.network.version == 4:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "netif.pyx":1619
 *     @property
 *     def af(self):
 *         if not self.network:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "netif.pyx":1622
 *             return None
 * 
 *         if self.network.version == 4:             # <<<<<<<<<<<<<<
 *             return AddressFamily.INET
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "netif.pyx":1623
 * 
 *         if self.network.version == 4:
 *             return AddressFamily.INET             # <<<<<<<<<<<<<<
 * 
 *         if self.network.version == 6:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1622
 *             return None
 * 
 *         if self.network.version == 4:             # <<<<<<<<<<<<<<
 *             return AddressFamily.INET
 * 
 */
  }

  /* "netif.pyx":1625
 *             return AddressFamily.INET
 * 
 *         if self.network.version == 6:             # <<<<<<<<<<<<<<
 *             return AddressFamily.INET6
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_network); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "netif.pyx":1626
 * 
 *         if self.network.version == 6:
 *             return AddressFamily.INET6             # <<<<<<<<<<<<<<
 * 
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_INET6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1625
 *             return AddressFamily.INET
 * 
 *         if self.network.version == 6:             # <<<<<<<<<<<<<<
 *             return AddressFamily.INET6
 * 
 */
  }

  /* "netif.pyx":1628
 *             return AddressFamily.INET6
 * 
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "netif.pyx":1618
 * 
 *     @property
 *     def af(self):             # <<<<<<<<<<<<<<
 *         if not self.network:
 *             return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.Route.af", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1630
 *         return None
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'network': str(self.network),
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5Route_5__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5Route_5__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_5netif_5Route_5__getstate__, METH_O, 0};
static PyObject *__pyx_pw_5netif_5Route_5__getstate__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_5Route_4__getstate__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_5Route_4__getstate__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "netif.pyx":1631
 * 
 *     def __getstate__(self):
 *         return {             # <<<<<<<<<<<<<<
 *             'network': str(self.network),
 *             'netmask': str(self.netmask) if self.netmask else None,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":1632
 *     def __getstate__(self):
 *         return {
 *             'network': str(self.network),             # <<<<<<<<<<<<<<
 *             'netmask': str(self.netmask) if self.netmask else None,
 *             'gateway': str(self.gateway) if self.gateway else None,
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_network, __pyx_t_2) < 0) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1633
 *         return {
 *             'network': str(self.network),
 *             'netmask': str(self.netmask) if self.netmask else None,             # <<<<<<<<<<<<<<
 *             'gateway': str(self.gateway) if self.gateway else None,
 *             'interface': self.interface or None,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_2 = Py_None;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_netmask, __pyx_t_2) < 0) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1634
 *             'network': str(self.network),
 *             'netmask': str(self.netmask) if self.netmask else None,
 *             'gateway': str(self.gateway) if self.gateway else None,             # <<<<<<<<<<<<<<
 *             'interface': self.interface or None,
 *             'flags': [x.name for x in self.flags]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gateway); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gateway); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_2 = Py_None;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gateway, __pyx_t_2) < 0) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1635
 *             'netmask': str(self.netmask) if self.netmask else None,
 *             'gateway': str(self.gateway) if self.gateway else None,
 *             'interface': self.interface or None,             # <<<<<<<<<<<<<<
 *             'flags': [x.name for x in self.flags]
 *         }
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1635, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(Py_None);
  __pyx_t_2 = Py_None;
  __pyx_L3_bool_binop_done:;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interface, __pyx_t_2) < 0) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1636
 *             'gateway': str(self.gateway) if self.gateway else None,
 *             'interface': self.interface or None,
 *             'flags': [x.name for x in self.flags]             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1636, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1636, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1636, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1636, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1630
 *         return None
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'network': str(self.network),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.Route.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1639
 *         }
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, Route):
 *             return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5Route_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5Route_7__eq__ = {"__eq__", (PyCFunction)__pyx_pw_5netif_5Route_7__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_5Route_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 1639, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 1639, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1639, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.Route.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_5Route_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_5Route_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "netif.pyx":1640
 * 
 *     def __eq__(self, other):
 *         if not isinstance(other, Route):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Route); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "netif.pyx":1641
 *     def __eq__(self, other):
 *         if not isinstance(other, Route):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         return self.network == other.network and \
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "netif.pyx":1640
 * 
 *     def __eq__(self, other):
 *         if not isinstance(other, Route):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "netif.pyx":1643
 *             return False
 * 
 *         return self.network == other.network and \             # <<<<<<<<<<<<<<
 *             self.netmask == other.netmask and \
 *             self.gateway == other.gateway
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_network); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_network); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1643, __pyx_L1_error)
  if (__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_1 = __pyx_t_6;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_bool_binop_done;
  }

  /* "netif.pyx":1644
 * 
 *         return self.network == other.network and \
 *             self.netmask == other.netmask and \             # <<<<<<<<<<<<<<
 *             self.gateway == other.gateway
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_netmask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1644, __pyx_L1_error)
  if (__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_bool_binop_done;
  }

  /* "netif.pyx":1645
 *         return self.network == other.network and \
 *             self.netmask == other.netmask and \
 *             self.gateway == other.gateway             # <<<<<<<<<<<<<<
 * 
 *     def __ne__(self, other):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gateway); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_gateway); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_1 = __pyx_t_6;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1639
 *         }
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, Route):
 *             return False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.Route.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1647
 *             self.gateway == other.gateway
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5Route_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5Route_9__ne__ = {"__ne__", (PyCFunction)__pyx_pw_5netif_5Route_9__ne__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_5Route_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 1647, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 1647, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1647, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.Route.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_5Route_8__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_5Route_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "netif.pyx":1648
 * 
 *     def __ne__(self, other):
 *         return not self == other             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1647
 *             self.gateway == other.gateway
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("netif.Route.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1650
 *         return not self == other
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((
 *             self.network,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5Route_11__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5Route_11__hash__ = {"__hash__", (PyCFunction)__pyx_pw_5netif_5Route_11__hash__, METH_O, 0};
static PyObject *__pyx_pw_5netif_5Route_11__hash__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_5Route_10__hash__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_5Route_10__hash__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_hash_t __pyx_t_5;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "netif.pyx":1651
 * 
 *     def __hash__(self):
 *         return hash((             # <<<<<<<<<<<<<<
 *             self.network,
 *             self.netmask,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "netif.pyx":1652
 *     def __hash__(self):
 *         return hash((
 *             self.network,             # <<<<<<<<<<<<<<
 *             self.netmask,
 *             self.gateway
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "netif.pyx":1653
 *         return hash((
 *             self.network,
 *             self.netmask,             # <<<<<<<<<<<<<<
 *             self.gateway
 *         ))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_netmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "netif.pyx":1654
 *             self.network,
 *             self.netmask,
 *             self.gateway             # <<<<<<<<<<<<<<
 *         ))
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_gateway); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1652
 *     def __hash__(self):
 *         return hash((
 *             self.network,             # <<<<<<<<<<<<<<
 *             self.netmask,
 *             self.gateway
 */
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "netif.pyx":1651
 * 
 *     def __hash__(self):
 *         return hash((             # <<<<<<<<<<<<<<
 *             self.network,
 *             self.netmask,
 */
  __pyx_t_5 = PyObject_Hash(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 1651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_FromHash_t(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1650
 *         return not self == other
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((
 *             self.network,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.Route.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1659
 * 
 * class RoutingTable(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5netif_12RoutingTable_1__init__, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12RoutingTable___init__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1662
 *         pass
 * 
 *     def __send_message(self, msg):             # <<<<<<<<<<<<<<
 *         if msg.type == RoutingMessageType.DELETE:
 *             msg.gateway = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_3__send_message(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_3__send_message = {"__send_message", (PyCFunction)__pyx_pw_5netif_12RoutingTable_3__send_message, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_3__send_message(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__send_message (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_msg,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__send_message", 1, 2, 2, 1); __PYX_ERR(0, 1662, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__send_message") < 0)) __PYX_ERR(0, 1662, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_msg = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__send_message", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1662, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingTable.__send_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_12RoutingTable_2__send_message(__pyx_self, __pyx_v_self, __pyx_v_msg);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable_2__send_message(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_msg) {
  PyObject *__pyx_v_sock = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__send_message", 0);

  /* "netif.pyx":1663
 * 
 *     def __send_message(self, msg):
 *         if msg.type == RoutingMessageType.DELETE:             # <<<<<<<<<<<<<<
 *             msg.gateway = None
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "netif.pyx":1664
 *     def __send_message(self, msg):
 *         if msg.type == RoutingMessageType.DELETE:
 *             msg.gateway = None             # <<<<<<<<<<<<<<
 * 
 *         sock = RoutingSocket()
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_msg, __pyx_n_s_gateway, Py_None) < 0) __PYX_ERR(0, 1664, __pyx_L1_error)

    /* "netif.pyx":1663
 * 
 *     def __send_message(self, msg):
 *         if msg.type == RoutingMessageType.DELETE:             # <<<<<<<<<<<<<<
 *             msg.gateway = None
 * 
 */
  }

  /* "netif.pyx":1666
 *             msg.gateway = None
 * 
 *         sock = RoutingSocket()             # <<<<<<<<<<<<<<
 *         sock.open()
 *         sock.write_message(msg)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingSocket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1666, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sock = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "netif.pyx":1667
 * 
 *         sock = RoutingSocket()
 *         sock.open()             # <<<<<<<<<<<<<<
 *         sock.write_message(msg)
 *         sock.close()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_open); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1667, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1668
 *         sock = RoutingSocket()
 *         sock.open()
 *         sock.write_message(msg)             # <<<<<<<<<<<<<<
 *         sock.close()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_write_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_msg);
    __Pyx_GIVEREF(__pyx_v_msg);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_msg);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1669
 *         sock.open()
 *         sock.write_message(msg)
 *         sock.close()             # <<<<<<<<<<<<<<
 * 
 *     def __send_route(self, type, route):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1669, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":1662
 *         pass
 * 
 *     def __send_message(self, msg):             # <<<<<<<<<<<<<<
 *         if msg.type == RoutingMessageType.DELETE:
 *             msg.gateway = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingTable.__send_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sock);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1671
 *         sock.close()
 * 
 *     def __send_route(self, type, route):             # <<<<<<<<<<<<<<
 *         msg = RoutingMessage()
 *         msg.type = type
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_5__send_route(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_5__send_route = {"__send_route", (PyCFunction)__pyx_pw_5netif_12RoutingTable_5__send_route, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_5__send_route(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_route = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__send_route (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,&__pyx_n_s_route,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__send_route", 1, 3, 3, 1); __PYX_ERR(0, 1671, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_route)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__send_route", 1, 3, 3, 2); __PYX_ERR(0, 1671, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__send_route") < 0)) __PYX_ERR(0, 1671, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_type = values[1];
    __pyx_v_route = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__send_route", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1671, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingTable.__send_route", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_12RoutingTable_4__send_route(__pyx_self, __pyx_v_self, __pyx_v_type, __pyx_v_route);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable_4__send_route(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_route) {
  struct __pyx_obj_5netif_RoutingMessage *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__send_route", 0);

  /* "netif.pyx":1672
 * 
 *     def __send_route(self, type, route):
 *         msg = RoutingMessage()             # <<<<<<<<<<<<<<
 *         msg.type = type
 *         msg.route = route
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5netif_RoutingMessage), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_5netif_RoutingMessage *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "netif.pyx":1673
 *     def __send_route(self, type, route):
 *         msg = RoutingMessage()
 *         msg.type = type             # <<<<<<<<<<<<<<
 *         msg.route = route
 *         self.__send_message(msg)
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_msg), __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(0, 1673, __pyx_L1_error)

  /* "netif.pyx":1674
 *         msg = RoutingMessage()
 *         msg.type = type
 *         msg.route = route             # <<<<<<<<<<<<<<
 *         self.__send_message(msg)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_msg), __pyx_n_s_route, __pyx_v_route) < 0) __PYX_ERR(0, 1674, __pyx_L1_error)

  /* "netif.pyx":1675
 *         msg.type = type
 *         msg.route = route
 *         self.__send_message(msg)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_RoutingTable__send_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_msg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_msg));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_msg));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_msg));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1671
 *         sock.close()
 * 
 *     def __send_route(self, type, route):             # <<<<<<<<<<<<<<
 *         msg = RoutingMessage()
 *         msg.type = type
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("netif.RoutingTable.__send_route", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1678
 * 
 *     @property
 *     def default_route_ipv4(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 *         return f[0] if len(f) > 0 else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_7default_route_ipv4(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_7default_route_ipv4 = {"default_route_ipv4", (PyCFunction)__pyx_pw_5netif_12RoutingTable_7default_route_ipv4, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_7default_route_ipv4(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_route_ipv4 (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12RoutingTable_6default_route_ipv4(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1679
 *     @property
 *     def default_route_ipv4(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if len(f) > 0 else None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_18default_route_ipv4_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_r); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_18default_route_ipv4_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_5netif_12RoutingTable_18default_route_ipv4_lambda1, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_18default_route_ipv4_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_r));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1679, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_netmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1679, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingTable.default_route_ipv4.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1678
 * 
 *     @property
 *     def default_route_ipv4(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 *         return f[0] if len(f) > 0 else None
 */

static PyObject *__pyx_pf_5netif_12RoutingTable_6default_route_ipv4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("default_route_ipv4", 0);

  /* "netif.pyx":1679
 *     @property
 *     def default_route_ipv4(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if len(f) > 0 else None
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_18default_route_ipv4_lambda1, 0, __pyx_n_s_RoutingTable_default_route_ipv4, NULL, __pyx_n_s_netif, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_routes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_f = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "netif.pyx":1680
 *     def default_route_ipv4(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 *         return f[0] if len(f) > 0 else None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_f); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1680, __pyx_L1_error)
  if (((__pyx_t_4 > 0) != 0)) {
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_f, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_3 = Py_None;
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1678
 * 
 *     @property
 *     def default_route_ipv4(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 *         return f[0] if len(f) > 0 else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingTable.default_route_ipv4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1683
 * 
 *     @property
 *     def default_route_ipv6(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 *         return f[0] if len(f) > 0 else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_9default_route_ipv6(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_9default_route_ipv6 = {"default_route_ipv6", (PyCFunction)__pyx_pw_5netif_12RoutingTable_9default_route_ipv6, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_9default_route_ipv6(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_route_ipv6 (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12RoutingTable_8default_route_ipv6(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1684
 *     @property
 *     def default_route_ipv6(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if len(f) > 0 else None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_18default_route_ipv6_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_r); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_18default_route_ipv6_lambda2 = {"lambda2", (PyCFunction)__pyx_pw_5netif_12RoutingTable_18default_route_ipv6_lambda2, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_18default_route_ipv6_lambda2(PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_r));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1684, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_netmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1684, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_af); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INET6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingTable.default_route_ipv6.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1683
 * 
 *     @property
 *     def default_route_ipv6(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 *         return f[0] if len(f) > 0 else None
 */

static PyObject *__pyx_pf_5netif_12RoutingTable_8default_route_ipv6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("default_route_ipv6", 0);

  /* "netif.pyx":1684
 *     @property
 *     def default_route_ipv6(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if len(f) > 0 else None
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_18default_route_ipv6_lambda2, 0, __pyx_n_s_RoutingTable_default_route_ipv6, NULL, __pyx_n_s_netif, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_routes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_f = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "netif.pyx":1685
 *     def default_route_ipv6(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 *         return f[0] if len(f) > 0 else None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_f); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1685, __pyx_L1_error)
  if (((__pyx_t_4 > 0) != 0)) {
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_f, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_3 = Py_None;
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1683
 * 
 *     @property
 *     def default_route_ipv6(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 *         return f[0] if len(f) > 0 else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingTable.default_route_ipv6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_12RoutingTable_12generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":1688
 * 
 *     @property
 *     def routes(self):             # <<<<<<<<<<<<<<
 *         cdef char* buf
 *         cdef defs.rt_msghdr* rt_msg
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_11routes(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_11routes = {"routes", (PyCFunction)__pyx_pw_5netif_12RoutingTable_11routes, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_11routes(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("routes (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12RoutingTable_10routes(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable_10routes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  struct __pyx_obj_5netif___pyx_scope_struct_3_routes *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("routes", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct_3_routes *)__pyx_tp_new_5netif___pyx_scope_struct_3_routes(__pyx_ptype_5netif___pyx_scope_struct_3_routes, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_12RoutingTable_12generator3, (PyObject *) __pyx_cur_scope, __pyx_n_s_routes, __pyx_n_s_RoutingTable_routes); if (unlikely(!gen)) __PYX_ERR(0, 1688, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingTable.routes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_12RoutingTable_12generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct_3_routes *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct_3_routes *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  char *__pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1688, __pyx_L1_error)

  /* "netif.pyx":1692
 *         cdef defs.rt_msghdr* rt_msg
 * 
 *         data = sysctl.sysctl([defs.CTL_NET, defs.AF_ROUTE, 0, 0, defs.NET_RT_DUMP, 0])             # <<<<<<<<<<<<<<
 *         data = array.array('b', data).tostring()
 *         buf = data
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sysctl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sysctl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(CTL_NET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ROUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(NET_RT_DUMP); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyList_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1693
 * 
 *         data = sysctl.sysctl([defs.CTL_NET, defs.AF_ROUTE, 0, 0, defs.NET_RT_DUMP, 0])
 *         data = array.array('b', data).tostring()             # <<<<<<<<<<<<<<
 *         buf = data
 *         ptr = 0
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_b);
  __Pyx_GIVEREF(__pyx_n_s_b);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_n_s_b);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_cur_scope->__pyx_v_data);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tostring); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_data);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_data, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "netif.pyx":1694
 *         data = sysctl.sysctl([defs.CTL_NET, defs.AF_ROUTE, 0, 0, defs.NET_RT_DUMP, 0])
 *         data = array.array('b', data).tostring()
 *         buf = data             # <<<<<<<<<<<<<<
 *         ptr = 0
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_cur_scope->__pyx_v_data); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L1_error)
  __pyx_cur_scope->__pyx_v_buf = __pyx_t_8;

  /* "netif.pyx":1695
 *         data = array.array('b', data).tostring()
 *         buf = data
 *         ptr = 0             # <<<<<<<<<<<<<<
 * 
 *         while ptr < len(data):
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_cur_scope->__pyx_v_ptr = __pyx_int_0;

  /* "netif.pyx":1697
 *         ptr = 0
 * 
 *         while ptr < len(data):             # <<<<<<<<<<<<<<
 *             rt_msg = <defs.rt_msghdr*>&buf[ptr]
 *             msg = RoutingMessage(data[ptr:ptr+rt_msg.rtm_msglen])
 */
  while (1) {
    __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_data); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_ptr, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!__pyx_t_9) break;

    /* "netif.pyx":1698
 * 
 *         while ptr < len(data):
 *             rt_msg = <defs.rt_msghdr*>&buf[ptr]             # <<<<<<<<<<<<<<
 *             msg = RoutingMessage(data[ptr:ptr+rt_msg.rtm_msglen])
 *             ptr += rt_msg.rtm_msglen
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_cur_scope->__pyx_v_ptr); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1698, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_rt_msg = ((struct rt_msghdr *)(&(__pyx_cur_scope->__pyx_v_buf[__pyx_t_7])));

    /* "netif.pyx":1699
 *         while ptr < len(data):
 *             rt_msg = <defs.rt_msghdr*>&buf[ptr]
 *             msg = RoutingMessage(data[ptr:ptr+rt_msg.rtm_msglen])             # <<<<<<<<<<<<<<
 *             ptr += rt_msg.rtm_msglen
 *             yield msg.route
 */
    __pyx_t_6 = __Pyx_PyInt_From_u_short(__pyx_cur_scope->__pyx_v_rt_msg->rtm_msglen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_ptr, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_data, 0, 0, &__pyx_cur_scope->__pyx_v_ptr, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5netif_RoutingMessage), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_msg));
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_msg, ((struct __pyx_obj_5netif_RoutingMessage *)__pyx_t_6));
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "netif.pyx":1700
 *             rt_msg = <defs.rt_msghdr*>&buf[ptr]
 *             msg = RoutingMessage(data[ptr:ptr+rt_msg.rtm_msglen])
 *             ptr += rt_msg.rtm_msglen             # <<<<<<<<<<<<<<
 *             yield msg.route
 * 
 */
    __pyx_t_6 = __Pyx_PyInt_From_u_short(__pyx_cur_scope->__pyx_v_rt_msg->rtm_msglen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_ptr, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ptr);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ptr, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "netif.pyx":1701
 *             msg = RoutingMessage(data[ptr:ptr+rt_msg.rtm_msglen])
 *             ptr += rt_msg.rtm_msglen
 *             yield msg.route             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_msg), __pyx_n_s_route); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1701, __pyx_L1_error)
  }

  /* "netif.pyx":1688
 * 
 *     @property
 *     def routes(self):             # <<<<<<<<<<<<<<
 *         cdef char* buf
 *         cdef defs.rt_msghdr* rt_msg
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("routes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1704
 * 
 *     @property
 *     def default_route(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 *         return f[0] if f else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_14default_route(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_14default_route = {"default_route", (PyCFunction)__pyx_pw_5netif_12RoutingTable_14default_route, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_14default_route(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_route (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12RoutingTable_13default_route(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1705
 *     @property
 *     def default_route(self):
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if f else None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_13default_route_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_r); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_13default_route_lambda3 = {"lambda3", (PyCFunction)__pyx_pw_5netif_12RoutingTable_13default_route_lambda3, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_13default_route_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, ((PyObject *)__pyx_v_r));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda3", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingTable.default_route.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1704
 * 
 *     @property
 *     def default_route(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 *         return f[0] if f else None
 */

static PyObject *__pyx_pf_5netif_12RoutingTable_13default_route(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("default_route", 0);

  /* "netif.pyx":1705
 *     @property
 *     def default_route(self):
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if f else None
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_13default_route_lambda3, 0, __pyx_n_s_RoutingTable_default_route_local, NULL, __pyx_n_s_netif, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_routes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_f = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "netif.pyx":1706
 *     def default_route(self):
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 *         return f[0] if f else None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = (__pyx_v_f != Py_None) && (PyList_GET_SIZE(__pyx_v_f) != 0);
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_f, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_3 = Py_None;
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1704
 * 
 *     @property
 *     def default_route(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 *         return f[0] if f else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingTable.default_route", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1709
 * 
 *     @property
 *     def static_routes(self):             # <<<<<<<<<<<<<<
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_16static_routes(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_16static_routes = {"static_routes", (PyCFunction)__pyx_pw_5netif_12RoutingTable_16static_routes, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_16static_routes(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("static_routes (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12RoutingTable_15static_routes(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1710
 *     @property
 *     def static_routes(self):
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))             # <<<<<<<<<<<<<<
 * 
 *     def add(self, route):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_13static_routes_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_r); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_13static_routes_lambda4 = {"lambda4", (PyCFunction)__pyx_pw_5netif_12RoutingTable_13static_routes_lambda4, METH_O, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_13static_routes_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self, ((PyObject *)__pyx_v_r));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_RouteFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_STATIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingTable.static_routes.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1709
 * 
 *     @property
 *     def static_routes(self):             # <<<<<<<<<<<<<<
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 */

static PyObject *__pyx_pf_5netif_12RoutingTable_15static_routes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("static_routes", 0);

  /* "netif.pyx":1710
 *     @property
 *     def static_routes(self):
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))             # <<<<<<<<<<<<<<
 * 
 *     def add(self, route):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_13static_routes_lambda4, 0, __pyx_n_s_RoutingTable_static_routes_local, NULL, __pyx_n_s_netif, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_routes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1709
 * 
 *     @property
 *     def static_routes(self):             # <<<<<<<<<<<<<<
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingTable.static_routes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1712
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 *     def add(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_18add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_18add = {"add", (PyCFunction)__pyx_pw_5netif_12RoutingTable_18add, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_18add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_route = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_route,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_route)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 1712, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 1712, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_route = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1712, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingTable.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_12RoutingTable_17add(__pyx_self, __pyx_v_self, __pyx_v_route);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable_17add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_route) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("add", 0);

  /* "netif.pyx":1713
 * 
 *     def add(self, route):
 *         self.__send_route(RoutingMessageType.ADD, route)             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, route):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_RoutingTable__send_route); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ADD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_route);
  __Pyx_GIVEREF(__pyx_v_route);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_route);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1712
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 *     def add(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.RoutingTable.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1715
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 *     def delete(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_20delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_20delete = {"delete", (PyCFunction)__pyx_pw_5netif_12RoutingTable_20delete, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_20delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_route = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_route,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_route)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, 1); __PYX_ERR(0, 1715, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(0, 1715, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_route = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1715, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingTable.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_12RoutingTable_19delete(__pyx_self, __pyx_v_self, __pyx_v_route);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable_19delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_route) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "netif.pyx":1716
 * 
 *     def delete(self, route):
 *         self.__send_route(RoutingMessageType.DELETE, route)             # <<<<<<<<<<<<<<
 * 
 *     def change(self, route):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_RoutingTable__send_route); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_route);
  __Pyx_GIVEREF(__pyx_v_route);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_route);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1715
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 *     def delete(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.RoutingTable.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1718
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 *     def change(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.CHANGE, route)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_12RoutingTable_22change(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_12RoutingTable_22change = {"change", (PyCFunction)__pyx_pw_5netif_12RoutingTable_22change, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_12RoutingTable_22change(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_route = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_route,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_route)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change", 1, 2, 2, 1); __PYX_ERR(0, 1718, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change") < 0)) __PYX_ERR(0, 1718, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_route = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingTable.change", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_12RoutingTable_21change(__pyx_self, __pyx_v_self, __pyx_v_route);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12RoutingTable_21change(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_route) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("change", 0);

  /* "netif.pyx":1719
 * 
 *     def change(self, route):
 *         self.__send_route(RoutingMessageType.CHANGE, route)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_RoutingTable__send_route); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CHANGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_route);
  __Pyx_GIVEREF(__pyx_v_route);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_route);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1718
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 *     def change(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.CHANGE, route)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("netif.RoutingTable.change", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1723
 * 
 * class RoutingSocket(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.socket = None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingSocket_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_13RoutingSocket_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5netif_13RoutingSocket_1__init__, METH_O, 0};
static PyObject *__pyx_pw_5netif_13RoutingSocket_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingSocket___init__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingSocket___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "netif.pyx":1724
 * class RoutingSocket(object):
 *     def __init__(self):
 *         self.socket = None             # <<<<<<<<<<<<<<
 * 
 *     def open(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_socket, Py_None) < 0) __PYX_ERR(0, 1724, __pyx_L1_error)

  /* "netif.pyx":1723
 * 
 * class RoutingSocket(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.socket = None
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.RoutingSocket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1726
 *         self.socket = None
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingSocket_3open(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_13RoutingSocket_3open = {"open", (PyCFunction)__pyx_pw_5netif_13RoutingSocket_3open, METH_O, 0};
static PyObject *__pyx_pw_5netif_13RoutingSocket_3open(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingSocket_2open(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingSocket_2open(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("open", 0);

  /* "netif.pyx":1727
 * 
 *     def open(self):
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AF_ROUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SOCK_RAW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_int_0);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_socket, __pyx_t_1) < 0) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1726
 *         self.socket = None
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.RoutingSocket.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1729
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.socket.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingSocket_5close(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_13RoutingSocket_5close = {"close", (PyCFunction)__pyx_pw_5netif_13RoutingSocket_5close, METH_O, 0};
static PyObject *__pyx_pw_5netif_13RoutingSocket_5close(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingSocket_4close(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingSocket_4close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("close", 0);

  /* "netif.pyx":1730
 * 
 *     def close(self):
 *         self.socket.close()             # <<<<<<<<<<<<<<
 * 
 *     def read_message(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1729
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.socket.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("netif.RoutingSocket.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1732
 *         self.socket.close()
 * 
 *     def read_message(self):             # <<<<<<<<<<<<<<
 *         cdef char* buffer
 *         cdef defs.rt_msghdr* rt_msg
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingSocket_7read_message(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5netif_13RoutingSocket_7read_message = {"read_message", (PyCFunction)__pyx_pw_5netif_13RoutingSocket_7read_message, METH_O, 0};
static PyObject *__pyx_pw_5netif_13RoutingSocket_7read_message(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_message (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_13RoutingSocket_6read_message(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingSocket_6read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  char *__pyx_v_buffer;
  struct rt_msghdr *__pyx_v_rt_msg;
  PyObject *__pyx_v_packet = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  char *__pyx_t_9;
  u_char __pyx_t_10;
  __Pyx_RefNannySetupContext("read_message", 0);

  /* "netif.pyx":1736
 *         cdef defs.rt_msghdr* rt_msg
 * 
 *         packet = os.read(self.socket.fileno(), 1024)             # <<<<<<<<<<<<<<
 * 
 *         if packet is None:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fileno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_2);
  __Pyx_INCREF(__pyx_int_1024);
  __Pyx_GIVEREF(__pyx_int_1024);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_int_1024);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_packet = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1738
 *         packet = os.read(self.socket.fileno(), 1024)
 * 
 *         if packet is None:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_7 = (__pyx_v_packet == Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "netif.pyx":1739
 * 
 *         if packet is None:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         buffer = <char*>packet
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "netif.pyx":1738
 *         packet = os.read(self.socket.fileno(), 1024)
 * 
 *         if packet is None:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "netif.pyx":1741
 *             return None
 * 
 *         buffer = <char*>packet             # <<<<<<<<<<<<<<
 *         rt_msg = <defs.rt_msghdr*>buffer
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_packet); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1741, __pyx_L1_error)
  __pyx_v_buffer = ((char *)__pyx_t_9);

  /* "netif.pyx":1742
 * 
 *         buffer = <char*>packet
 *         rt_msg = <defs.rt_msghdr*>buffer             # <<<<<<<<<<<<<<
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.IFANNOUNCE, RoutingMessageType.IEEE80211):
 */
  __pyx_v_rt_msg = ((struct rt_msghdr *)__pyx_v_buffer);

  /* "netif.pyx":1744
 *         rt_msg = <defs.rt_msghdr*>buffer
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.IFANNOUNCE, RoutingMessageType.IEEE80211):             # <<<<<<<<<<<<<<
 *             return InterfaceAnnounceMessage(packet)
 * 
 */
  __pyx_t_10 = __pyx_v_rt_msg->rtm_type;
  __pyx_t_1 = __Pyx_PyInt_From_u_char(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_IFANNOUNCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_7) {
  } else {
    __pyx_t_8 = __pyx_t_7;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_u_char(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_IEEE80211); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __pyx_t_7;
  __pyx_L5_bool_binop_done:;
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "netif.pyx":1745
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.IFANNOUNCE, RoutingMessageType.IEEE80211):
 *             return InterfaceAnnounceMessage(packet)             # <<<<<<<<<<<<<<
 * 
 *         if rt_msg.rtm_type == RoutingMessageType.IFINFO:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_packet);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5netif_InterfaceAnnounceMessage), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1744
 *         rt_msg = <defs.rt_msghdr*>buffer
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.IFANNOUNCE, RoutingMessageType.IEEE80211):             # <<<<<<<<<<<<<<
 *             return InterfaceAnnounceMessage(packet)
 * 
 */
  }

  /* "netif.pyx":1747
 *             return InterfaceAnnounceMessage(packet)
 * 
 *         if rt_msg.rtm_type == RoutingMessageType.IFINFO:             # <<<<<<<<<<<<<<
 *             return InterfaceInfoMessage(packet)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_u_char(__pyx_v_rt_msg->rtm_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_IFINFO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_7) {

    /* "netif.pyx":1748
 * 
 *         if rt_msg.rtm_type == RoutingMessageType.IFINFO:
 *             return InterfaceInfoMessage(packet)             # <<<<<<<<<<<<<<
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.NEWADDR, RoutingMessageType.DELADDR):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_packet);
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5netif_InterfaceInfoMessage), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1747
 *             return InterfaceAnnounceMessage(packet)
 * 
 *         if rt_msg.rtm_type == RoutingMessageType.IFINFO:             # <<<<<<<<<<<<<<
 *             return InterfaceInfoMessage(packet)
 * 
 */
  }

  /* "netif.pyx":1750
 *             return InterfaceInfoMessage(packet)
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.NEWADDR, RoutingMessageType.DELADDR):             # <<<<<<<<<<<<<<
 *             return InterfaceAddrMessage(packet)
 * 
 */
  __pyx_t_10 = __pyx_v_rt_msg->rtm_type;
  __pyx_t_3 = __Pyx_PyInt_From_u_char(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NEWADDR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyInt_From_u_char(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RoutingMessageType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DELADDR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_t_8;
  __pyx_L9_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "netif.pyx":1751
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.NEWADDR, RoutingMessageType.DELADDR):
 *             return InterfaceAddrMessage(packet)             # <<<<<<<<<<<<<<
 * 
 *         return RoutingMessage(packet)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_packet);
    __Pyx_GIVEREF(__pyx_v_packet);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_packet);
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5netif_InterfaceAddrMessage), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "netif.pyx":1750
 *             return InterfaceInfoMessage(packet)
 * 
 *         if rt_msg.rtm_type in (RoutingMessageType.NEWADDR, RoutingMessageType.DELADDR):             # <<<<<<<<<<<<<<
 *             return InterfaceAddrMessage(packet)
 * 
 */
  }

  /* "netif.pyx":1753
 *             return InterfaceAddrMessage(packet)
 * 
 *         return RoutingMessage(packet)             # <<<<<<<<<<<<<<
 * 
 *     def write_message(self, message):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_packet);
  __Pyx_GIVEREF(__pyx_v_packet);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_packet);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5netif_RoutingMessage), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1732
 *         self.socket.close()
 * 
 *     def read_message(self):             # <<<<<<<<<<<<<<
 *         cdef char* buffer
 *         cdef defs.rt_msghdr* rt_msg
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingSocket.read_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_packet);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1755
 *         return RoutingMessage(packet)
 * 
 *     def write_message(self, message):             # <<<<<<<<<<<<<<
 *         buf = message.as_buffer()
 *         os.write(self.socket.fileno(), buf)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13RoutingSocket_9write_message(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_13RoutingSocket_9write_message = {"write_message", (PyCFunction)__pyx_pw_5netif_13RoutingSocket_9write_message, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_13RoutingSocket_9write_message(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_message (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_message", 1, 2, 2, 1); __PYX_ERR(0, 1755, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_message") < 0)) __PYX_ERR(0, 1755, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_message", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1755, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.RoutingSocket.write_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_13RoutingSocket_8write_message(__pyx_self, __pyx_v_self, __pyx_v_message);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_13RoutingSocket_8write_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  PyObject *__pyx_v_buf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("write_message", 0);

  /* "netif.pyx":1756
 * 
 *     def write_message(self, message):
 *         buf = message.as_buffer()             # <<<<<<<<<<<<<<
 *         os.write(self.socket.fileno(), buf)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "netif.pyx":1757
 *     def write_message(self, message):
 *         buf = message.as_buffer()
 *         os.write(self.socket.fileno(), buf)             # <<<<<<<<<<<<<<
 * 
 * def get_ifgroup(groupname):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fileno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_buf);
  __Pyx_GIVEREF(__pyx_v_buf);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_buf);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1755
 *         return RoutingMessage(packet)
 * 
 *     def write_message(self, message):             # <<<<<<<<<<<<<<
 *         buf = message.as_buffer()
 *         os.write(self.socket.fileno(), buf)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.RoutingSocket.write_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1759
 *         os.write(self.socket.fileno(), buf)
 * 
 * def get_ifgroup(groupname):             # <<<<<<<<<<<<<<
 *     """Given group name such as vnet or bridge, get group members"""
 *     cdef defs.ifgroupreq ifgr
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_1get_ifgroup(PyObject *__pyx_self, PyObject *__pyx_v_groupname); /*proto*/
static char __pyx_doc_5netif_get_ifgroup[] = "Given group name such as vnet or bridge, get group members";
static PyMethodDef __pyx_mdef_5netif_1get_ifgroup = {"get_ifgroup", (PyCFunction)__pyx_pw_5netif_1get_ifgroup, METH_O, __pyx_doc_5netif_get_ifgroup};
static PyObject *__pyx_pw_5netif_1get_ifgroup(PyObject *__pyx_self, PyObject *__pyx_v_groupname) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_ifgroup (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_get_ifgroup(__pyx_self, ((PyObject *)__pyx_v_groupname));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_get_ifgroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_groupname) {
  struct ifgroupreq __pyx_v_ifgr;
  struct ifg_req *__pyx_v_ifg;
  int __pyx_v_len;
  char *__pyx_v_mem;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  char const *__pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  unsigned int __pyx_t_15;
  struct ifg_req *__pyx_t_16;
  char *__pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  int __pyx_t_27;
  __Pyx_RefNannySetupContext("get_ifgroup", 0);
  __Pyx_INCREF(__pyx_v_groupname);

  /* "netif.pyx":1766
 *     cdef char *mem
 * 
 *     groupname = groupname.encode('ascii')             # <<<<<<<<<<<<<<
 *     result = []
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_groupname, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_groupname, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "netif.pyx":1767
 * 
 *     groupname = groupname.encode('ascii')
 *     result = []             # <<<<<<<<<<<<<<
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "netif.pyx":1768
 *     groupname = groupname.encode('ascii')
 *     result = []
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 *         strcpy(ifgr.ifgr_name, groupname)
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sock3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AF_UNIX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SOCK_DGRAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1768, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_s = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "netif.pyx":1769
 *     result = []
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:
 *         memset(&ifgr, 0, cython.sizeof(ifgr))             # <<<<<<<<<<<<<<
 *         strcpy(ifgr.ifgr_name, groupname)
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 */
          memset((&__pyx_v_ifgr), 0, (sizeof(__pyx_v_ifgr)));

          /* "netif.pyx":1770
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 *         strcpy(ifgr.ifgr_name, groupname)             # <<<<<<<<<<<<<<
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *             if errno in (EINVAL, ENOTTY, ENOENT):
 */
          __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_groupname); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 1770, __pyx_L7_error)
          strcpy(__pyx_v_ifgr.ifgr_name, __pyx_t_12);

          /* "netif.pyx":1771
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 *         strcpy(ifgr.ifgr_name, groupname)
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:             # <<<<<<<<<<<<<<
 *             if errno in (EINVAL, ENOTTY, ENOENT):
 *                 return result
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (__pyx_t_1) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1771, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1771, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_14 = ((ioctl(__pyx_t_13, SIOCGIFGMEMB, ((void *)(&__pyx_v_ifgr))) == -1L) != 0);
          if (__pyx_t_14) {

            /* "netif.pyx":1772
 *         strcpy(ifgr.ifgr_name, groupname)
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *             if errno in (EINVAL, ENOTTY, ENOENT):             # <<<<<<<<<<<<<<
 *                 return result
 *             raise OSError(errno, os.strerror(errno))
 */
            switch (errno) {
              case EINVAL:
              case ENOTTY:
              case ENOENT:

              /* "netif.pyx":1773
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *             if errno in (EINVAL, ENOTTY, ENOENT):
 *                 return result             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 *         len = ifgr.ifgr_len
 */
              __Pyx_XDECREF(__pyx_r);
              __Pyx_INCREF(__pyx_v_result);
              __pyx_r = __pyx_v_result;
              goto __pyx_L11_try_return;

              /* "netif.pyx":1772
 *         strcpy(ifgr.ifgr_name, groupname)
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *             if errno in (EINVAL, ENOTTY, ENOENT):             # <<<<<<<<<<<<<<
 *                 return result
 *             raise OSError(errno, os.strerror(errno))
 */
              break;
              default: break;
            }

            /* "netif.pyx":1774
 *             if errno in (EINVAL, ENOTTY, ENOENT):
 *                 return result
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 *         len = ifgr.ifgr_len
 *         mem = NULL
 */
            __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1774, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1774, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1774, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1774, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
              }
            }
            if (!__pyx_t_4) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_t_2);
            } else {
              __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1774, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1774, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
            __pyx_t_7 = 0;
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 1774, __pyx_L7_error)

            /* "netif.pyx":1771
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 *         strcpy(ifgr.ifgr_name, groupname)
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:             # <<<<<<<<<<<<<<
 *             if errno in (EINVAL, ENOTTY, ENOENT):
 *                 return result
 */
          }

          /* "netif.pyx":1775
 *                 return result
 *             raise OSError(errno, os.strerror(errno))
 *         len = ifgr.ifgr_len             # <<<<<<<<<<<<<<
 *         mem = NULL
 *         try:
 */
          __pyx_t_15 = __pyx_v_ifgr.ifgr_len;
          __pyx_v_len = __pyx_t_15;

          /* "netif.pyx":1776
 *             raise OSError(errno, os.strerror(errno))
 *         len = ifgr.ifgr_len
 *         mem = NULL             # <<<<<<<<<<<<<<
 *         try:
 *             mem = <char*>malloc(len)
 */
          __pyx_v_mem = NULL;

          /* "netif.pyx":1777
 *         len = ifgr.ifgr_len
 *         mem = NULL
 *         try:             # <<<<<<<<<<<<<<
 *             mem = <char*>malloc(len)
 *             memset(mem, 0, len)
 */
          /*try:*/ {

            /* "netif.pyx":1778
 *         mem = NULL
 *         try:
 *             mem = <char*>malloc(len)             # <<<<<<<<<<<<<<
 *             memset(mem, 0, len)
 *             ifgr.ifgr_ifgru.ifgru_groups = <defs.ifg_req*>mem
 */
            __pyx_v_mem = ((char *)malloc(__pyx_v_len));

            /* "netif.pyx":1779
 *         try:
 *             mem = <char*>malloc(len)
 *             memset(mem, 0, len)             # <<<<<<<<<<<<<<
 *             ifgr.ifgr_ifgru.ifgru_groups = <defs.ifg_req*>mem
 *             if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 */
            memset(__pyx_v_mem, 0, __pyx_v_len);

            /* "netif.pyx":1780
 *             mem = <char*>malloc(len)
 *             memset(mem, 0, len)
 *             ifgr.ifgr_ifgru.ifgru_groups = <defs.ifg_req*>mem             # <<<<<<<<<<<<<<
 *             if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 */
            __pyx_v_ifgr.ifgr_ifgru.ifgru_groups = ((struct ifg_req *)__pyx_v_mem);

            /* "netif.pyx":1781
 *             memset(mem, 0, len)
 *             ifgr.ifgr_ifgru.ifgru_groups = <defs.ifg_req*>mem
 *             if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 *             ifg = ifgr.ifgr_ifgru.ifgru_groups
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1781, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
              }
            }
            if (__pyx_t_7) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            } else {
              __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L19_error)
            }
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L19_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_14 = ((ioctl(__pyx_t_13, SIOCGIFGMEMB, ((void *)(&__pyx_v_ifgr))) == -1L) != 0);
            if (__pyx_t_14) {

              /* "netif.pyx":1782
 *             ifgr.ifgr_ifgru.ifgru_groups = <defs.ifg_req*>mem
 *             if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *                 raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 *             ifg = ifgr.ifgr_ifgru.ifgru_groups
 *             while len >= cython.sizeof(defs.ifg_req):
 */
              __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_strerror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_1 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
                if (likely(__pyx_t_1)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                  __Pyx_INCREF(__pyx_t_1);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_3, function);
                }
              }
              if (!__pyx_t_1) {
                __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L19_error)
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_5);
              } else {
                __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1782, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
                __Pyx_GIVEREF(__pyx_t_7);
                PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
                __pyx_t_7 = 0;
                __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
              __pyx_t_2 = 0;
              __pyx_t_5 = 0;
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_Raise(__pyx_t_5, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __PYX_ERR(0, 1782, __pyx_L19_error)

              /* "netif.pyx":1781
 *             memset(mem, 0, len)
 *             ifgr.ifgr_ifgru.ifgru_groups = <defs.ifg_req*>mem
 *             if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:             # <<<<<<<<<<<<<<
 *                 raise OSError(errno, os.strerror(errno))
 *             ifg = ifgr.ifgr_ifgru.ifgru_groups
 */
            }

            /* "netif.pyx":1783
 *             if defs.ioctl(s.fileno(), defs.SIOCGIFGMEMB, <void*>&ifgr) == -1:
 *                 raise OSError(errno, os.strerror(errno))
 *             ifg = ifgr.ifgr_ifgru.ifgru_groups             # <<<<<<<<<<<<<<
 *             while len >= cython.sizeof(defs.ifg_req):
 *                 result.append(ifg.ifgrq_ifgrqu.ifgrqu_member.decode('ascii'))
 */
            __pyx_t_16 = __pyx_v_ifgr.ifgr_ifgru.ifgru_groups;
            __pyx_v_ifg = __pyx_t_16;

            /* "netif.pyx":1784
 *                 raise OSError(errno, os.strerror(errno))
 *             ifg = ifgr.ifgr_ifgru.ifgru_groups
 *             while len >= cython.sizeof(defs.ifg_req):             # <<<<<<<<<<<<<<
 *                 result.append(ifg.ifgrq_ifgrqu.ifgrqu_member.decode('ascii'))
 *                 ifg += 1
 */
            while (1) {
              __pyx_t_14 = ((__pyx_v_len >= (sizeof(struct ifg_req))) != 0);
              if (!__pyx_t_14) break;

              /* "netif.pyx":1785
 *             ifg = ifgr.ifgr_ifgru.ifgru_groups
 *             while len >= cython.sizeof(defs.ifg_req):
 *                 result.append(ifg.ifgrq_ifgrqu.ifgrqu_member.decode('ascii'))             # <<<<<<<<<<<<<<
 *                 ifg += 1
 *                 len -= cython.sizeof(defs.ifg_req)
 */
              __pyx_t_17 = __pyx_v_ifg->ifgrq_ifgrqu.ifgrqu_member;
              __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_17, 0, strlen(__pyx_t_17), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1785, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 1785, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

              /* "netif.pyx":1786
 *             while len >= cython.sizeof(defs.ifg_req):
 *                 result.append(ifg.ifgrq_ifgrqu.ifgrqu_member.decode('ascii'))
 *                 ifg += 1             # <<<<<<<<<<<<<<
 *                 len -= cython.sizeof(defs.ifg_req)
 *         finally:
 */
              __pyx_v_ifg = (__pyx_v_ifg + 1);

              /* "netif.pyx":1787
 *                 result.append(ifg.ifgrq_ifgrqu.ifgrqu_member.decode('ascii'))
 *                 ifg += 1
 *                 len -= cython.sizeof(defs.ifg_req)             # <<<<<<<<<<<<<<
 *         finally:
 *             if mem:
 */
              __pyx_v_len = (__pyx_v_len - (sizeof(struct ifg_req)));
            }
          }

          /* "netif.pyx":1789
 *                 len -= cython.sizeof(defs.ifg_req)
 *         finally:
 *             if mem:             # <<<<<<<<<<<<<<
 *                 free(mem)
 *     return result
 */
          /*finally:*/ {
            /*normal exit:*/{
              __pyx_t_14 = (__pyx_v_mem != 0);
              if (__pyx_t_14) {

                /* "netif.pyx":1790
 *         finally:
 *             if mem:
 *                 free(mem)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
                free(__pyx_v_mem);

                /* "netif.pyx":1789
 *                 len -= cython.sizeof(defs.ifg_req)
 *         finally:
 *             if mem:             # <<<<<<<<<<<<<<
 *                 free(mem)
 *     return result
 */
              }
              goto __pyx_L20;
            }
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __pyx_L19_error:;
              __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
              __Pyx_PyThreadState_assign
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __pyx_t_13 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
              {
                __pyx_t_14 = (__pyx_v_mem != 0);
                if (__pyx_t_14) {

                  /* "netif.pyx":1790
 *         finally:
 *             if mem:
 *                 free(mem)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
                  free(__pyx_v_mem);

                  /* "netif.pyx":1789
 *                 len -= cython.sizeof(defs.ifg_req)
 *         finally:
 *             if mem:             # <<<<<<<<<<<<<<
 *                 free(mem)
 *     return result
 */
                }
              }
              __Pyx_PyThreadState_assign
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_24);
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
              }
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23);
              __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
              __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
              goto __pyx_L7_error;
            }
            __pyx_L20:;
          }

          /* "netif.pyx":1768
 *     groupname = groupname.encode('ascii')
 *     result = []
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 *         strcpy(ifgr.ifgr_name, groupname)
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("netif.get_ifgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 1768, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1768, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_26);
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_26);
          __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
          if (__pyx_t_14 < 0) __PYX_ERR(0, 1768, __pyx_L9_except_error)
          __pyx_t_27 = ((!(__pyx_t_14 != 0)) != 0);
          if (__pyx_t_27) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_3, __pyx_t_2);
            __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 1768, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__24, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1768, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_11 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_8) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__25, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1768, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __pyx_r = __pyx_t_11;
        __pyx_t_11 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L33;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L33:;
  }

  /* "netif.pyx":1791
 *             if mem:
 *                 free(mem)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef int _get_in6_ifa_flags(char* name, defs.sockaddr_in6* sin6):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1759
 *         os.write(self.socket.fileno(), buf)
 * 
 * def get_ifgroup(groupname):             # <<<<<<<<<<<<<<
 *     """Given group name such as vnet or bridge, get group members"""
 *     cdef defs.ifgroupreq ifgr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.get_ifgroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_groupname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1793
 *     return result
 * 
 * cdef int _get_in6_ifa_flags(char* name, defs.sockaddr_in6* sin6):             # <<<<<<<<<<<<<<
 *     cdef defs.in6_ifreq ifr6
 * 
 */

static int __pyx_f_5netif__get_in6_ifa_flags(char *__pyx_v_name, struct sockaddr_in6 *__pyx_v_sin6) {
  struct in6_ifreq __pyx_v_ifr6;
  PyObject *__pyx_v_s = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("_get_in6_ifa_flags", 0);

  /* "netif.pyx":1796
 *     cdef defs.in6_ifreq ifr6
 * 
 *     memset(&ifr6, 0, cython.sizeof(ifr6))             # <<<<<<<<<<<<<<
 *     strcpy(ifr6.ifr_name, name)
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 */
  memset((&__pyx_v_ifr6), 0, (sizeof(__pyx_v_ifr6)));

  /* "netif.pyx":1797
 * 
 *     memset(&ifr6, 0, cython.sizeof(ifr6))
 *     strcpy(ifr6.ifr_name, name)             # <<<<<<<<<<<<<<
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:
 */
  strcpy(__pyx_v_ifr6.ifr_name, __pyx_v_name);

  /* "netif.pyx":1798
 *     memset(&ifr6, 0, cython.sizeof(ifr6))
 *     strcpy(ifr6.ifr_name, name)
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]             # <<<<<<<<<<<<<<
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:
 */
  __pyx_v_ifr6.ifr_ifru.ifru_addr = (__pyx_v_sin6[0]);

  /* "netif.pyx":1799
 *     strcpy(ifr6.ifr_name, name)
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:
 *             return -1
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sock3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AF_INET6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SOCK_DGRAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1799, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_s = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "netif.pyx":1800
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:             # <<<<<<<<<<<<<<
 *             return -1
 *         # Might want to get ifa lifetime here too, while
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (__pyx_t_2) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1800, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          } else {
            __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1800, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1800, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_13 = ((ioctl(__pyx_t_12, SIOCGIFAFLAG_IN6, ((void *)(&__pyx_v_ifr6))) == -1L) != 0);
          if (__pyx_t_13) {

            /* "netif.pyx":1801
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:
 *             return -1             # <<<<<<<<<<<<<<
 *         # Might want to get ifa lifetime here too, while
 *         # we have ifr6 set up, and socket s.  But not yet.
 */
            __pyx_r = -1;
            goto __pyx_L11_try_return;

            /* "netif.pyx":1800
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:             # <<<<<<<<<<<<<<
 *             return -1
 *         # Might want to get ifa lifetime here too, while
 */
          }

          /* "netif.pyx":1799
 *     strcpy(ifr6.ifr_name, name)
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:
 *             return -1
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("netif._get_in6_ifa_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 1799, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1799, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1799, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_13 < 0) __PYX_ERR(0, 1799, __pyx_L9_except_error)
          __pyx_t_15 = ((!(__pyx_t_13 != 0)) != 0);
          if (__pyx_t_15) {
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_1, __pyx_t_2);
            __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 1799, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1799, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_12 = __pyx_r;
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__27, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1799, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __pyx_r = __pyx_t_12;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "netif.pyx":1804
 *         # Might want to get ifa lifetime here too, while
 *         # we have ifr6 set up, and socket s.  But not yet.
 *     return ifr6.ifr_ifru.ifru_flags6             # <<<<<<<<<<<<<<
 * 
 * cdef list_interfaces_internal(names, typemap, defs.ifaddrs* ifa):
 */
  __pyx_r = __pyx_v_ifr6.ifr_ifru.ifru_flags6;
  goto __pyx_L0;

  /* "netif.pyx":1793
 *     return result
 * 
 * cdef int _get_in6_ifa_flags(char* name, defs.sockaddr_in6* sin6):             # <<<<<<<<<<<<<<
 *     cdef defs.in6_ifreq ifr6
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("netif._get_in6_ifa_flags", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_24list_interfaces_internal_2generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":1821
 *         # the last one here overrides due to the update().
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 */

static PyObject *__pyx_pf_5netif_24list_interfaces_internal_genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *)__pyx_tp_new_5netif___pyx_scope_struct_4_genexpr(__pyx_ptype_5netif___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_24list_interfaces_internal_2generator4, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_list_interfaces_internal_locals); if (unlikely(!gen)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.list_interfaces_internal.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_24list_interfaces_internal_2generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1821, __pyx_L1_error)
  __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_ifgroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1821, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1821, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1821, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_i, (PyObject*)__pyx_ptype_5netif_VlanInterface))) __PYX_ERR(0, 1821, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_24list_interfaces_internal_5generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":1822
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))
 */

static PyObject *__pyx_pf_5netif_24list_interfaces_internal_3genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *)__pyx_tp_new_5netif___pyx_scope_struct_5_genexpr(__pyx_ptype_5netif___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_24list_interfaces_internal_5generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_list_interfaces_internal_locals); if (unlikely(!gen)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.list_interfaces_internal.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_24list_interfaces_internal_5generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_ifgroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1822, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1822, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1822, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_i, (PyObject*)__pyx_ptype_5netif_LaggInterface))) __PYX_ERR(0, 1822, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5netif_24list_interfaces_internal_8generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "netif.pyx":1823
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)             # <<<<<<<<<<<<<<
 *                             for i in get_ifgroup('bridge')))
 * 
 */

static PyObject *__pyx_pf_5netif_24list_interfaces_internal_6genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *)__pyx_tp_new_5netif___pyx_scope_struct_6_genexpr(__pyx_ptype_5netif___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5netif_24list_interfaces_internal_8generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_list_interfaces_internal_locals); if (unlikely(!gen)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("netif.list_interfaces_internal.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5netif_24list_interfaces_internal_8generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1823, __pyx_L1_error)
  __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);

  /* "netif.pyx":1824
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))             # <<<<<<<<<<<<<<
 * 
 *     result = {}
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_ifgroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1824, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1824, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1824, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1824, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "netif.pyx":1823
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)             # <<<<<<<<<<<<<<
 *                             for i in get_ifgroup('bridge')))
 * 
 */
    if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_i, (PyObject*)__pyx_ptype_5netif_BridgeInterface))) __PYX_ERR(0, 1823, __pyx_L1_error)

    /* "netif.pyx":1824
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))             # <<<<<<<<<<<<<<
 * 
 *     result = {}
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1823
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)             # <<<<<<<<<<<<<<
 *                             for i in get_ifgroup('bridge')))
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1806
 *     return ifr6.ifr_ifru.ifru_flags6
 * 
 * cdef list_interfaces_internal(names, typemap, defs.ifaddrs* ifa):             # <<<<<<<<<<<<<<
 *     cdef defs.sockaddr_in* sin
 *     cdef defs.sockaddr_in6* sin6
 */

static PyObject *__pyx_f_5netif_list_interfaces_internal(PyObject *__pyx_v_names, PyObject *__pyx_v_typemap, struct ifaddrs *__pyx_v_ifa) {
  struct sockaddr_in *__pyx_v_sin;
  struct sockaddr_in6 *__pyx_v_sin6;
  struct sockaddr_dl *__pyx_v_sdl;
  struct sockaddr *__pyx_v_sa;
  struct if_data *__pyx_v_ifd;
  struct __pyx_obj_5netif_NetworkInterface *__pyx_v_iface = 0;
  PyObject *__pyx_v_itype = 0;
  int __pyx_v_ia6_flags;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_nic = NULL;
  PyObject *__pyx_v_addr = NULL;
  unsigned char __pyx_v_x;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  int __pyx_t_9;
  struct ifaddrs *__pyx_t_10;
  Py_ssize_t __pyx_t_11;
  struct sockaddr *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  unsigned char __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  __Pyx_RefNannySetupContext("list_interfaces_internal", 0);
  __Pyx_INCREF(__pyx_v_typemap);

  /* "netif.pyx":1816
 *     cdef int ia6_flags
 * 
 *     if typemap is None:             # <<<<<<<<<<<<<<
 *         # NB: we assume no vlan is a lagg, etc.  If someone has
 *         # erroneously shoved an interface into multiple groups,
 */
  __pyx_t_1 = (__pyx_v_typemap == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "netif.pyx":1820
 *         # erroneously shoved an interface into multiple groups,
 *         # the last one here overrides due to the update().
 *         typemap = {}             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_typemap, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "netif.pyx":1821
 *         # the last one here overrides due to the update().
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_typemap, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_pf_5netif_24list_interfaces_internal_genexpr(NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":1822
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_typemap, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __pyx_pf_5netif_24list_interfaces_internal_3genexpr(NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1822, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":1823
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)             # <<<<<<<<<<<<<<
 *                             for i in get_ifgroup('bridge')))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_typemap, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_pf_5netif_24list_interfaces_internal_6genexpr(NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1823, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":1816
 *     cdef int ia6_flags
 * 
 *     if typemap is None:             # <<<<<<<<<<<<<<
 *         # NB: we assume no vlan is a lagg, etc.  If someone has
 *         # erroneously shoved an interface into multiple groups,
 */
  }

  /* "netif.pyx":1826
 *                             for i in get_ifgroup('bridge')))
 * 
 *     result = {}             # <<<<<<<<<<<<<<
 *     while ifa:
 *         name = ifa.ifa_name.decode('ascii')
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "netif.pyx":1827
 * 
 *     result = {}
 *     while ifa:             # <<<<<<<<<<<<<<
 *         name = ifa.ifa_name.decode('ascii')
 *         if names is not None and name not in names:
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_ifa != 0);
    if (!__pyx_t_2) break;

    /* "netif.pyx":1828
 *     result = {}
 *     while ifa:
 *         name = ifa.ifa_name.decode('ascii')             # <<<<<<<<<<<<<<
 *         if names is not None and name not in names:
 *             ifa = ifa.ifa_next
 */
    __pyx_t_8 = __pyx_v_ifa->ifa_name;
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "netif.pyx":1829
 *     while ifa:
 *         name = ifa.ifa_name.decode('ascii')
 *         if names is not None and name not in names:             # <<<<<<<<<<<<<<
 *             ifa = ifa.ifa_next
 *             continue
 */
    __pyx_t_1 = (__pyx_v_names != Py_None);
    __pyx_t_9 = (__pyx_t_1 != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_2 = __pyx_t_9;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_v_names, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1829, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_9 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "netif.pyx":1830
 *         name = ifa.ifa_name.decode('ascii')
 *         if names is not None and name not in names:
 *             ifa = ifa.ifa_next             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_t_10 = __pyx_v_ifa->ifa_next;
      __pyx_v_ifa = __pyx_t_10;

      /* "netif.pyx":1831
 *         if names is not None and name not in names:
 *             ifa = ifa.ifa_next
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if name not in result:
 */
      goto __pyx_L4_continue;

      /* "netif.pyx":1829
 *     while ifa:
 *         name = ifa.ifa_name.decode('ascii')
 *         if names is not None and name not in names:             # <<<<<<<<<<<<<<
 *             ifa = ifa.ifa_next
 *             continue
 */
    }

    /* "netif.pyx":1833
 *             continue
 * 
 *         if name not in result:             # <<<<<<<<<<<<<<
 *             itype = typemap.get(name, NetworkInterface)
 *             iface = itype.__new__(itype)
 */
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_result, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":1834
 * 
 *         if name not in result:
 *             itype = typemap.get(name, NetworkInterface)             # <<<<<<<<<<<<<<
 *             iface = itype.__new__(itype)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_typemap, __pyx_n_s_get_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_11, __pyx_v_name);
      __Pyx_INCREF(((PyObject *)__pyx_ptype_5netif_NetworkInterface));
      __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5netif_NetworkInterface));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_11, ((PyObject *)__pyx_ptype_5netif_NetworkInterface));
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_itype, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "netif.pyx":1835
 *         if name not in result:
 *             itype = typemap.get(name, NetworkInterface)
 *             iface = itype.__new__(itype)             # <<<<<<<<<<<<<<
 * 
 *             iface.name = name
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_itype, __pyx_n_s_new); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_itype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1835, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_itype);
        __Pyx_GIVEREF(__pyx_v_itype);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_itype);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5netif_NetworkInterface))))) __PYX_ERR(0, 1835, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_iface, ((struct __pyx_obj_5netif_NetworkInterface *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "netif.pyx":1837
 *             iface = itype.__new__(itype)
 * 
 *             iface.name = name             # <<<<<<<<<<<<<<
 *             iface.nameb = name.encode('ascii')
 *             iface.addresses = []
 */
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      __Pyx_GOTREF(__pyx_v_iface->name);
      __Pyx_DECREF(__pyx_v_iface->name);
      __pyx_v_iface->name = __pyx_v_name;

      /* "netif.pyx":1838
 * 
 *             iface.name = name
 *             iface.nameb = name.encode('ascii')             # <<<<<<<<<<<<<<
 *             iface.addresses = []
 *             result[name] = iface
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_iface->nameb);
      __Pyx_DECREF(__pyx_v_iface->nameb);
      __pyx_v_iface->nameb = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "netif.pyx":1839
 *             iface.name = name
 *             iface.nameb = name.encode('ascii')
 *             iface.addresses = []             # <<<<<<<<<<<<<<
 *             result[name] = iface
 * 
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_iface->addresses);
      __Pyx_DECREF(__pyx_v_iface->addresses);
      __pyx_v_iface->addresses = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "netif.pyx":1840
 *             iface.nameb = name.encode('ascii')
 *             iface.addresses = []
 *             result[name] = iface             # <<<<<<<<<<<<<<
 * 
 *         nic = result[name]
 */
      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_name, ((PyObject *)__pyx_v_iface)) < 0)) __PYX_ERR(0, 1840, __pyx_L1_error)

      /* "netif.pyx":1833
 *             continue
 * 
 *         if name not in result:             # <<<<<<<<<<<<<<
 *             itype = typemap.get(name, NetworkInterface)
 *             iface = itype.__new__(itype)
 */
    }

    /* "netif.pyx":1842
 *             result[name] = iface
 * 
 *         nic = result[name]             # <<<<<<<<<<<<<<
 *         sa = ifa.ifa_addr
 *         addr = InterfaceAddress(AddressFamily(sa.sa_family))
 */
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_nic, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "netif.pyx":1843
 * 
 *         nic = result[name]
 *         sa = ifa.ifa_addr             # <<<<<<<<<<<<<<
 *         addr = InterfaceAddress(AddressFamily(sa.sa_family))
 * 
 */
    __pyx_t_12 = __pyx_v_ifa->ifa_addr;
    __pyx_v_sa = __pyx_t_12;

    /* "netif.pyx":1844
 *         nic = result[name]
 *         sa = ifa.ifa_addr
 *         addr = InterfaceAddress(AddressFamily(sa.sa_family))             # <<<<<<<<<<<<<<
 * 
 *         if sa.sa_family == defs.AF_INET:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceAddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_AddressFamily); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_From_sa_family_t(__pyx_v_sa->sa_family); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_13 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_13) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_addr, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "netif.pyx":1846
 *         addr = InterfaceAddress(AddressFamily(sa.sa_family))
 * 
 *         if sa.sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *             if ifa.ifa_addr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_addr
 */
    __pyx_t_1 = ((__pyx_v_sa->sa_family == AF_INET) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":1847
 * 
 *         if sa.sa_family == defs.AF_INET:
 *             if ifa.ifa_addr != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_addr
 *                 addr.address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_addr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1848
 *         if sa.sa_family == defs.AF_INET:
 *             if ifa.ifa_addr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_addr             # <<<<<<<<<<<<<<
 *                 addr.address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 */
        __pyx_v_sin = ((struct sockaddr_in *)__pyx_v_ifa->ifa_addr);

        /* "netif.pyx":1849
 *             if ifa.ifa_addr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_addr
 *                 addr.address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))             # <<<<<<<<<<<<<<
 * 
 *             if ifa.ifa_netmask != NULL:
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_sin->sin_addr.s_addr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1849, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1849, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_address, __pyx_t_4) < 0) __PYX_ERR(0, 1849, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1847
 * 
 *         if sa.sa_family == defs.AF_INET:
 *             if ifa.ifa_addr != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_addr
 *                 addr.address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      }

      /* "netif.pyx":1851
 *                 addr.address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             if ifa.ifa_netmask != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_netmask
 *                 addr.netmask = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_netmask != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1852
 * 
 *             if ifa.ifa_netmask != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_netmask             # <<<<<<<<<<<<<<
 *                 addr.netmask = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 */
        __pyx_v_sin = ((struct sockaddr_in *)__pyx_v_ifa->ifa_netmask);

        /* "netif.pyx":1853
 *             if ifa.ifa_netmask != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_netmask
 *                 addr.netmask = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))             # <<<<<<<<<<<<<<
 * 
 *             if ifa.ifa_broadaddr != NULL:
 */
        __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_sin->sin_addr.s_addr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_14);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_14);
          __pyx_t_14 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_netmask, __pyx_t_4) < 0) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1851
 *                 addr.address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             if ifa.ifa_netmask != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_netmask
 *                 addr.netmask = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      }

      /* "netif.pyx":1855
 *                 addr.netmask = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             if ifa.ifa_broadaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_broadaddr
 *                 addr.broadcast = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_broadaddr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1856
 * 
 *             if ifa.ifa_broadaddr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_broadaddr             # <<<<<<<<<<<<<<
 *                 addr.broadcast = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 */
        __pyx_v_sin = ((struct sockaddr_in *)__pyx_v_ifa->ifa_broadaddr);

        /* "netif.pyx":1857
 *             if ifa.ifa_broadaddr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_broadaddr
 *                 addr.broadcast = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))             # <<<<<<<<<<<<<<
 * 
 *             elif ifa.ifa_dstaddr != NULL:
 */
        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyInt_From_uint32_t(__pyx_v_sin->sin_addr.s_addr); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_3 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_13);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_14);
          __pyx_t_14 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_broadcast, __pyx_t_4) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1855
 *                 addr.netmask = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             if ifa.ifa_broadaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_broadaddr
 *                 addr.broadcast = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
        goto __pyx_L13;
      }

      /* "netif.pyx":1859
 *                 addr.broadcast = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             elif ifa.ifa_dstaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_dstaddr
 *                 addr.dest_address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_dstaddr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1860
 * 
 *             elif ifa.ifa_dstaddr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_dstaddr             # <<<<<<<<<<<<<<
 *                 addr.dest_address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 */
        __pyx_v_sin = ((struct sockaddr_in *)__pyx_v_ifa->ifa_dstaddr);

        /* "netif.pyx":1861
 *             elif ifa.ifa_dstaddr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_dstaddr
 *                 addr.dest_address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))             # <<<<<<<<<<<<<<
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ntohl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyInt_From_uint32_t(__pyx_v_sin->sin_addr.s_addr); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_14) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_14); __pyx_t_14 = NULL;
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_dest_address, __pyx_t_4) < 0) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1859
 *                 addr.broadcast = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             elif ifa.ifa_dstaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin = <defs.sockaddr_in*>ifa.ifa_dstaddr
 *                 addr.dest_address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 */
      }
      __pyx_L13:;

      /* "netif.pyx":1863
 *                 addr.dest_address = ipaddress.ip_address(socket.ntohl(sin.sin_addr.s_addr))
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data             # <<<<<<<<<<<<<<
 *             if ifd.ifi_vhid != 0:
 *                 addr.vhid = ifd.ifi_vhid
 */
      __pyx_v_ifd = ((struct if_data *)__pyx_v_ifa->ifa_data);

      /* "netif.pyx":1864
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data
 *             if ifd.ifi_vhid != 0:             # <<<<<<<<<<<<<<
 *                 addr.vhid = ifd.ifi_vhid
 * 
 */
      __pyx_t_1 = ((__pyx_v_ifd->ifi_vhid != 0) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1865
 *             ifd = <defs.if_data*>ifa.ifa_data
 *             if ifd.ifi_vhid != 0:
 *                 addr.vhid = ifd.ifi_vhid             # <<<<<<<<<<<<<<
 * 
 *         if sa.sa_family == defs.AF_INET6:
 */
        __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_ifd->ifi_vhid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_vhid, __pyx_t_4) < 0) __PYX_ERR(0, 1865, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1864
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data
 *             if ifd.ifi_vhid != 0:             # <<<<<<<<<<<<<<
 *                 addr.vhid = ifd.ifi_vhid
 * 
 */
      }

      /* "netif.pyx":1846
 *         addr = InterfaceAddress(AddressFamily(sa.sa_family))
 * 
 *         if sa.sa_family == defs.AF_INET:             # <<<<<<<<<<<<<<
 *             if ifa.ifa_addr != NULL:
 *                 sin = <defs.sockaddr_in*>ifa.ifa_addr
 */
    }

    /* "netif.pyx":1867
 *                 addr.vhid = ifd.ifi_vhid
 * 
 *         if sa.sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *             if ifa.ifa_addr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_addr
 */
    __pyx_t_1 = ((__pyx_v_sa->sa_family == AF_INET6) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":1868
 * 
 *         if sa.sa_family == defs.AF_INET6:
 *             if ifa.ifa_addr != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_addr
 *                 addr.address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_addr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1869
 *         if sa.sa_family == defs.AF_INET6:
 *             if ifa.ifa_addr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_addr             # <<<<<<<<<<<<<<
 *                 addr.address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 *                 # Get flags for this address.  Note that they're
 */
        __pyx_v_sin6 = ((struct sockaddr_in6 *)__pyx_v_ifa->ifa_addr);

        /* "netif.pyx":1870
 *             if ifa.ifa_addr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_addr
 *                 addr.address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])             # <<<<<<<<<<<<<<
 *                 # Get flags for this address.  Note that they're
 *                 # stored via the interface address (which is what
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1870, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1870, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sin6->sin6_addr.s6_addr) + 0, 16 - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1870, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1870, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1870, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1870, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_address, __pyx_t_4) < 0) __PYX_ERR(0, 1870, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1878
 *                 # the address?).  For now, we leave addr.ipv6_flags
 *                 # set to None.
 *                 ia6_flags = _get_in6_ifa_flags(iface.nameb, sin6)             # <<<<<<<<<<<<<<
 *                 if ia6_flags != -1:
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 */
        if (unlikely(!__pyx_v_iface)) { __Pyx_RaiseUnboundLocalError("iface"); __PYX_ERR(0, 1878, __pyx_L1_error) }
        __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_iface->nameb); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1878, __pyx_L1_error)
        __pyx_v_ia6_flags = __pyx_f_5netif__get_in6_ifa_flags(__pyx_t_8, __pyx_v_sin6);

        /* "netif.pyx":1879
 *                 # set to None.
 *                 ia6_flags = _get_in6_ifa_flags(iface.nameb, sin6)
 *                 if ia6_flags != -1:             # <<<<<<<<<<<<<<
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 *                 if str(addr.address).startswith('fe80:'):
 */
        __pyx_t_1 = ((__pyx_v_ia6_flags != -1L) != 0);
        if (__pyx_t_1) {

          /* "netif.pyx":1880
 *                 ia6_flags = _get_in6_ifa_flags(iface.nameb, sin6)
 *                 if ia6_flags != -1:
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)             # <<<<<<<<<<<<<<
 *                 if str(addr.address).startswith('fe80:'):
 *                     addr.scope = sin6.sin6_scope_id
 */
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bitmask_to_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1880, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ia6_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1880, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_In6AddrFlags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1880, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = NULL;
          __pyx_t_11 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_11 = 1;
            }
          }
          __pyx_t_13 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1880, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_11, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_11, __pyx_t_7);
          __pyx_t_6 = 0;
          __pyx_t_7 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1880, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_ipv6_flags, __pyx_t_4) < 0) __PYX_ERR(0, 1880, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "netif.pyx":1879
 *                 # set to None.
 *                 ia6_flags = _get_in6_ifa_flags(iface.nameb, sin6)
 *                 if ia6_flags != -1:             # <<<<<<<<<<<<<<
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 *                 if str(addr.address).startswith('fe80:'):
 */
        }

        /* "netif.pyx":1881
 *                 if ia6_flags != -1:
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 *                 if str(addr.address).startswith('fe80:'):             # <<<<<<<<<<<<<<
 *                     addr.scope = sin6.sin6_scope_id
 * 
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_addr, __pyx_n_s_address); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1881, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1881, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1881, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1881, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_1) {

          /* "netif.pyx":1882
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 *                 if str(addr.address).startswith('fe80:'):
 *                     addr.scope = sin6.sin6_scope_id             # <<<<<<<<<<<<<<
 * 
 *             if ifa.ifa_netmask != NULL:
 */
          __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_sin6->sin6_scope_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_scope, __pyx_t_4) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "netif.pyx":1881
 *                 if ia6_flags != -1:
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 *                 if str(addr.address).startswith('fe80:'):             # <<<<<<<<<<<<<<
 *                     addr.scope = sin6.sin6_scope_id
 * 
 */
        }

        /* "netif.pyx":1868
 * 
 *         if sa.sa_family == defs.AF_INET6:
 *             if ifa.ifa_addr != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_addr
 *                 addr.address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      }

      /* "netif.pyx":1884
 *                     addr.scope = sin6.sin6_scope_id
 * 
 *             if ifa.ifa_netmask != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_netmask
 *                 addr.netmask = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_netmask != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1885
 * 
 *             if ifa.ifa_netmask != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_netmask             # <<<<<<<<<<<<<<
 *                 addr.netmask = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 */
        __pyx_v_sin6 = ((struct sockaddr_in6 *)__pyx_v_ifa->ifa_netmask);

        /* "netif.pyx":1886
 *             if ifa.ifa_netmask != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_netmask
 *                 addr.netmask = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])             # <<<<<<<<<<<<<<
 * 
 *             if ifa.ifa_broadaddr != NULL:
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1886, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1886, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sin6->sin6_addr.s6_addr) + 0, 16 - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1886, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1886, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1886, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1886, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_netmask, __pyx_t_4) < 0) __PYX_ERR(0, 1886, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1884
 *                     addr.scope = sin6.sin6_scope_id
 * 
 *             if ifa.ifa_netmask != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_netmask
 *                 addr.netmask = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      }

      /* "netif.pyx":1888
 *                 addr.netmask = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             if ifa.ifa_broadaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_broadaddr
 *                 addr.broadcast = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_broadaddr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1889
 * 
 *             if ifa.ifa_broadaddr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_broadaddr             # <<<<<<<<<<<<<<
 *                 addr.broadcast = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 */
        __pyx_v_sin6 = ((struct sockaddr_in6 *)__pyx_v_ifa->ifa_broadaddr);

        /* "netif.pyx":1890
 *             if ifa.ifa_broadaddr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_broadaddr
 *                 addr.broadcast = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])             # <<<<<<<<<<<<<<
 * 
 *             if ifa.ifa_dstaddr != NULL:
 */
        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sin6->sin6_addr.s6_addr) + 0, 16 - 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1890, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1890, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1890, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_broadcast, __pyx_t_4) < 0) __PYX_ERR(0, 1890, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1888
 *                 addr.netmask = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             if ifa.ifa_broadaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_broadaddr
 *                 addr.broadcast = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      }

      /* "netif.pyx":1892
 *                 addr.broadcast = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             if ifa.ifa_dstaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_dstaddr
 *                 addr.dest_address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_dstaddr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1893
 * 
 *             if ifa.ifa_dstaddr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_dstaddr             # <<<<<<<<<<<<<<
 *                 addr.dest_address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 */
        __pyx_v_sin6 = ((struct sockaddr_in6 *)__pyx_v_ifa->ifa_dstaddr);

        /* "netif.pyx":1894
 *             if ifa.ifa_dstaddr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_dstaddr
 *                 addr.dest_address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])             # <<<<<<<<<<<<<<
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1894, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1894, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sin6->sin6_addr.s6_addr) + 0, 16 - 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1894, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1894, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __pyx_t_13 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1894, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_dest_address, __pyx_t_4) < 0) __PYX_ERR(0, 1894, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1892
 *                 addr.broadcast = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             if ifa.ifa_dstaddr != NULL:             # <<<<<<<<<<<<<<
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_dstaddr
 *                 addr.dest_address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 */
      }

      /* "netif.pyx":1896
 *                 addr.dest_address = ipaddress.ip_address(sin6.sin6_addr.s6_addr[:16])
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data             # <<<<<<<<<<<<<<
 *             if ifd.ifi_vhid != 0:
 *                 addr.vhid = ifd.ifi_vhid
 */
      __pyx_v_ifd = ((struct if_data *)__pyx_v_ifa->ifa_data);

      /* "netif.pyx":1897
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data
 *             if ifd.ifi_vhid != 0:             # <<<<<<<<<<<<<<
 *                 addr.vhid = ifd.ifi_vhid
 * 
 */
      __pyx_t_1 = ((__pyx_v_ifd->ifi_vhid != 0) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1898
 *             ifd = <defs.if_data*>ifa.ifa_data
 *             if ifd.ifi_vhid != 0:
 *                 addr.vhid = ifd.ifi_vhid             # <<<<<<<<<<<<<<
 * 
 *         if sa.sa_family == defs.AF_LINK:
 */
        __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_ifd->ifi_vhid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_vhid, __pyx_t_4) < 0) __PYX_ERR(0, 1898, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1897
 * 
 *             ifd = <defs.if_data*>ifa.ifa_data
 *             if ifd.ifi_vhid != 0:             # <<<<<<<<<<<<<<
 *                 addr.vhid = ifd.ifi_vhid
 * 
 */
      }

      /* "netif.pyx":1867
 *                 addr.vhid = ifd.ifi_vhid
 * 
 *         if sa.sa_family == defs.AF_INET6:             # <<<<<<<<<<<<<<
 *             if ifa.ifa_addr != NULL:
 *                 sin6 = <defs.sockaddr_in6*>ifa.ifa_addr
 */
    }

    /* "netif.pyx":1900
 *                 addr.vhid = ifd.ifi_vhid
 * 
 *         if sa.sa_family == defs.AF_LINK:             # <<<<<<<<<<<<<<
 *             if ifa.ifa_addr != NULL:
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 */
    __pyx_t_1 = ((__pyx_v_sa->sa_family == AF_LINK) != 0);
    if (__pyx_t_1) {

      /* "netif.pyx":1901
 * 
 *         if sa.sa_family == defs.AF_LINK:
 *             if ifa.ifa_addr != NULL:             # <<<<<<<<<<<<<<
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 *                 nic.type = InterfaceType(sdl.sdl_type)
 */
      __pyx_t_1 = ((__pyx_v_ifa->ifa_addr != NULL) != 0);
      if (__pyx_t_1) {

        /* "netif.pyx":1902
 *         if sa.sa_family == defs.AF_LINK:
 *             if ifa.ifa_addr != NULL:
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr             # <<<<<<<<<<<<<<
 *                 nic.type = InterfaceType(sdl.sdl_type)
 *                 addr.address = LinkAddress(
 */
        __pyx_v_sdl = ((struct sockaddr_dl *)__pyx_v_ifa->ifa_addr);

        /* "netif.pyx":1903
 *             if ifa.ifa_addr != NULL:
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 *                 nic.type = InterfaceType(sdl.sdl_type)             # <<<<<<<<<<<<<<
 *                 addr.address = LinkAddress(
 *                     sdl.sdl_data[:sdl.sdl_nlen],
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyInt_From_u_char(__pyx_v_sdl->sdl_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1903, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_nic, __pyx_n_s_type, __pyx_t_4) < 0) __PYX_ERR(0, 1903, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1904
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 *                 nic.type = InterfaceType(sdl.sdl_type)
 *                 addr.address = LinkAddress(             # <<<<<<<<<<<<<<
 *                     sdl.sdl_data[:sdl.sdl_nlen],
 *                     ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])]))
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_LinkAddress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "netif.pyx":1905
 *                 nic.type = InterfaceType(sdl.sdl_type)
 *                 addr.address = LinkAddress(
 *                     sdl.sdl_data[:sdl.sdl_nlen],             # <<<<<<<<<<<<<<
 *                     ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])]))
 * 
 */
        __pyx_t_13 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sdl->sdl_data) + 0, __pyx_v_sdl->sdl_nlen - 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1905, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);

        /* "netif.pyx":1906
 *                 addr.address = LinkAddress(
 *                     sdl.sdl_data[:sdl.sdl_nlen],
 *                     ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])]))             # <<<<<<<<<<<<<<
 * 
 *         nic.addresses.append(addr)
 */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_sdl->sdl_data) + __pyx_v_sdl->sdl_nlen, (__pyx_v_sdl->sdl_nlen + __pyx_v_sdl->sdl_alen) - __pyx_v_sdl->sdl_nlen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_15 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          {
            __pyx_t_6 = __pyx_t_15(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1906, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __pyx_t_16 = __Pyx_PyInt_As_unsigned_char(__pyx_t_6); if (unlikely((__pyx_t_16 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 1906, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_x = __pyx_t_16;
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_02x, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1906, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_17 = __Pyx_PyInt_From_unsigned_char(__pyx_v_x); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1906, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_18 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_18)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_18);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          if (!__pyx_t_18) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1906, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1906, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
            __Pyx_GIVEREF(__pyx_t_17);
            PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_17);
            __pyx_t_17 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1906, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1906, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        __pyx_t_11 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_11 = 1;
          }
        }
        __pyx_t_6 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_11, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_11, __pyx_t_5);
        __pyx_t_13 = 0;
        __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "netif.pyx":1904
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 *                 nic.type = InterfaceType(sdl.sdl_type)
 *                 addr.address = LinkAddress(             # <<<<<<<<<<<<<<
 *                     sdl.sdl_data[:sdl.sdl_nlen],
 *                     ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])]))
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_addr, __pyx_n_s_address, __pyx_t_4) < 0) __PYX_ERR(0, 1904, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "netif.pyx":1901
 * 
 *         if sa.sa_family == defs.AF_LINK:
 *             if ifa.ifa_addr != NULL:             # <<<<<<<<<<<<<<
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 *                 nic.type = InterfaceType(sdl.sdl_type)
 */
      }

      /* "netif.pyx":1900
 *                 addr.vhid = ifd.ifi_vhid
 * 
 *         if sa.sa_family == defs.AF_LINK:             # <<<<<<<<<<<<<<
 *             if ifa.ifa_addr != NULL:
 *                 sdl = <defs.sockaddr_dl*>ifa.ifa_addr
 */
    }

    /* "netif.pyx":1908
 *                     ':'.join(['{0:02x}'.format(x) for x in bytearray(sdl.sdl_data[sdl.sdl_nlen:sdl.sdl_nlen+sdl.sdl_alen])]))
 * 
 *         nic.addresses.append(addr)             # <<<<<<<<<<<<<<
 * 
 *         ifa = ifa.ifa_next
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nic, __pyx_n_s_addresses); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_addr); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 1908, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "netif.pyx":1910
 *         nic.addresses.append(addr)
 * 
 *         ifa = ifa.ifa_next             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_10 = __pyx_v_ifa->ifa_next;
    __pyx_v_ifa = __pyx_t_10;
    __pyx_L4_continue:;
  }

  /* "netif.pyx":1912
 *         ifa = ifa.ifa_next
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def list_interfaces(names=None, typemap=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1806
 *     return ifr6.ifr_ifru.ifru_flags6
 * 
 * cdef list_interfaces_internal(names, typemap, defs.ifaddrs* ifa):             # <<<<<<<<<<<<<<
 *     cdef defs.sockaddr_in* sin
 *     cdef defs.sockaddr_in6* sin6
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("netif.list_interfaces_internal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_iface);
  __Pyx_XDECREF(__pyx_v_itype);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_nic);
  __Pyx_XDECREF(__pyx_v_addr);
  __Pyx_XDECREF(__pyx_v_typemap);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1914
 *     return result
 * 
 * def list_interfaces(names=None, typemap=None):             # <<<<<<<<<<<<<<
 *     """
 *     Return a dictionary of all interfaces in the system.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_3list_interfaces(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5netif_2list_interfaces[] = "\n    Return a dictionary of all interfaces in the system.\n\n    If you supply a list (or anything indexable, really) of names\n    and a type-map we'll only return interfaces that are in that\n    list and we'll use the type-mapper to make their instances.\n    This is mostly for internal use, in get_interface(), but it's\n    valid for any caller, e.g.:\n\n        result = list_interfaces(names=['em0', 'lo0'])\n\n    to get information on just those two interfaces, or:\n\n        result = list_interfaces(names=['mgmt0'],\n                                 typemap={'mgmt0': BridgeInterface})\n\n    to get information on mgmt0.  Note that the latter is\n    basically the same as:\n\n        get_interface('mgmt0', force_type='bridge')\n\n    but will return an empty dictionary if the interface doesn't\n    exist.\n    ";
static PyMethodDef __pyx_mdef_5netif_3list_interfaces = {"list_interfaces", (PyCFunction)__pyx_pw_5netif_3list_interfaces, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5netif_2list_interfaces};
static PyObject *__pyx_pw_5netif_3list_interfaces(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_typemap = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_interfaces (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_names,&__pyx_n_s_typemap,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typemap);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_interfaces") < 0)) __PYX_ERR(0, 1914, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_names = values[0];
    __pyx_v_typemap = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_interfaces", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1914, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.list_interfaces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_2list_interfaces(__pyx_self, __pyx_v_names, __pyx_v_typemap);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_2list_interfaces(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_names, PyObject *__pyx_v_typemap) {
  struct ifaddrs *__pyx_v_ifa;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  char const *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("list_interfaces", 0);

  /* "netif.pyx":1941
 *     cdef defs.ifaddrs* ifa
 * 
 *     if defs.getifaddrs(&ifa) != 0:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = ((getifaddrs((&__pyx_v_ifa)) != 0) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":1942
 * 
 *     if defs.getifaddrs(&ifa) != 0:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return list_interfaces_internal(names, typemap, ifa)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "netif.pyx":1941
 *     cdef defs.ifaddrs* ifa
 * 
 *     if defs.getifaddrs(&ifa) != 0:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "netif.pyx":1943
 *     if defs.getifaddrs(&ifa) != 0:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return list_interfaces_internal(names, typemap, ifa)
 *     finally:
 */
  /*try:*/ {

    /* "netif.pyx":1944
 *         return None
 *     try:
 *         return list_interfaces_internal(names, typemap, ifa)             # <<<<<<<<<<<<<<
 *     finally:
 *         defs.freeifaddrs(ifa)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_5netif_list_interfaces_internal(__pyx_v_names, __pyx_v_typemap, __pyx_v_ifa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1944, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4_return;
  }

  /* "netif.pyx":1946
 *         return list_interfaces_internal(names, typemap, ifa)
 *     finally:
 *         defs.freeifaddrs(ifa)             # <<<<<<<<<<<<<<
 * 
 * def bitmask_to_set(n, enumeration):
 */
  /*finally:*/ {
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __pyx_L5_error:;
      __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
      {
        freeifaddrs(__pyx_v_ifa);
      }
      __Pyx_PyThreadState_assign
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
      __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_11 = __pyx_r;
      __pyx_r = 0;
      freeifaddrs(__pyx_v_ifa);
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      goto __pyx_L0;
    }
  }

  /* "netif.pyx":1914
 *     return result
 * 
 * def list_interfaces(names=None, typemap=None):             # <<<<<<<<<<<<<<
 *     """
 *     Return a dictionary of all interfaces in the system.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("netif.list_interfaces", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1948
 *         defs.freeifaddrs(ifa)
 * 
 * def bitmask_to_set(n, enumeration):             # <<<<<<<<<<<<<<
 *     result = set()
 *     while n:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_5bitmask_to_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5netif_5bitmask_to_set = {"bitmask_to_set", (PyCFunction)__pyx_pw_5netif_5bitmask_to_set, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5netif_5bitmask_to_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_v_enumeration = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bitmask_to_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_enumeration,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enumeration)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bitmask_to_set", 1, 2, 2, 1); __PYX_ERR(0, 1948, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bitmask_to_set") < 0)) __PYX_ERR(0, 1948, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_n = values[0];
    __pyx_v_enumeration = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bitmask_to_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1948, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("netif.bitmask_to_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_4bitmask_to_set(__pyx_self, __pyx_v_n, __pyx_v_enumeration);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_4bitmask_to_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_enumeration) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("bitmask_to_set", 0);
  __Pyx_INCREF(__pyx_v_n);

  /* "netif.pyx":1949
 * 
 * def bitmask_to_set(n, enumeration):
 *     result = set()             # <<<<<<<<<<<<<<
 *     while n:
 *         b = n & (~n+1)
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "netif.pyx":1950
 * def bitmask_to_set(n, enumeration):
 *     result = set()
 *     while n:             # <<<<<<<<<<<<<<
 *         b = n & (~n+1)
 *         try:
 */
  while (1) {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_n); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1950, __pyx_L1_error)
    if (!__pyx_t_2) break;

    /* "netif.pyx":1951
 *     result = set()
 *     while n:
 *         b = n & (~n+1)             # <<<<<<<<<<<<<<
 *         try:
 *             result.add(enumeration(b))
 */
    __pyx_t_1 = PyNumber_Invert(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_And(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "netif.pyx":1952
 *     while n:
 *         b = n & (~n+1)
 *         try:             # <<<<<<<<<<<<<<
 *             result.add(enumeration(b))
 *         except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "netif.pyx":1953
 *         b = n & (~n+1)
 *         try:
 *             result.add(enumeration(b))             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             pass
 */
        __Pyx_INCREF(__pyx_v_enumeration);
        __pyx_t_3 = __pyx_v_enumeration; __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1953, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_INCREF(__pyx_v_b);
          __Pyx_GIVEREF(__pyx_v_b);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_b);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = PySet_Add(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1953, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "netif.pyx":1952
 *     while n:
 *         b = n & (~n+1)
 *         try:             # <<<<<<<<<<<<<<
 *             result.add(enumeration(b))
 *         except ValueError:
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "netif.pyx":1954
 *         try:
 *             result.add(enumeration(b))
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_10) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "netif.pyx":1952
 *     while n:
 *         b = n & (~n+1)
 *         try:             # <<<<<<<<<<<<<<
 *             result.add(enumeration(b))
 *         except ValueError:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L12_try_end:;
    }

    /* "netif.pyx":1957
 *             pass
 * 
 *         n ^= b             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_1 = PyNumber_InPlaceXor(__pyx_v_n, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "netif.pyx":1959
 *         n ^= b
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1948
 *         defs.freeifaddrs(ifa)
 * 
 * def bitmask_to_set(n, enumeration):             # <<<<<<<<<<<<<<
 *     result = set()
 *     while n:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.bitmask_to_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1962
 * 
 * 
 * def set_to_bitmask(value):             # <<<<<<<<<<<<<<
 *     result = 0
 *     for i in value:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_7set_to_bitmask(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_5netif_7set_to_bitmask = {"set_to_bitmask", (PyCFunction)__pyx_pw_5netif_7set_to_bitmask, METH_O, 0};
static PyObject *__pyx_pw_5netif_7set_to_bitmask(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_to_bitmask (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_6set_to_bitmask(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_6set_to_bitmask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("set_to_bitmask", 0);

  /* "netif.pyx":1963
 * 
 * def set_to_bitmask(value):
 *     result = 0             # <<<<<<<<<<<<<<
 *     for i in value:
 *         result |= int(i)
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_result = __pyx_int_0;

  /* "netif.pyx":1964
 * def set_to_bitmask(value):
 *     result = 0
 *     for i in value:             # <<<<<<<<<<<<<<
 *         result |= int(i)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_value)) || PyTuple_CheckExact(__pyx_v_value)) {
    __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1964, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1964, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1964, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1964, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "netif.pyx":1965
 *     result = 0
 *     for i in value:
 *         result |= int(i)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "netif.pyx":1964
 * def set_to_bitmask(value):
 *     result = 0
 *     for i in value:             # <<<<<<<<<<<<<<
 *         result |= int(i)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1967
 *         result |= int(i)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "netif.pyx":1962
 * 
 * 
 * def set_to_bitmask(value):             # <<<<<<<<<<<<<<
 *     result = 0
 *     for i in value:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("netif.set_to_bitmask", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1970
 * 
 * 
 * def get_interface(name, force_type=None, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Get the given interface.  Raises KeyError if interface does
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_9get_interface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5netif_8get_interface[] = "\n    Get the given interface.  Raises KeyError if interface does\n    not exist.  If force_type is provided it should be a string\n    in ('bridge', 'lagg', 'vlan') and it sets the type of the\n    interface.\n\n    For compatibility we temporarily allow bridge=True as a\n    keyword argument that sets force_type='bridge'.\n    ";
static PyMethodDef __pyx_mdef_5netif_9get_interface = {"get_interface", (PyCFunction)__pyx_pw_5netif_9get_interface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5netif_8get_interface};
static PyObject *__pyx_pw_5netif_9get_interface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_force_type = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_interface (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_force_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "get_interface") < 0)) __PYX_ERR(0, 1970, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_force_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_interface", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1970, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("netif.get_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5netif_8get_interface(__pyx_self, __pyx_v_name, __pyx_v_force_type, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_8get_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_force_type, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_typemap = NULL;
  PyObject *__pyx_v_itype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("get_interface", 0);
  __Pyx_INCREF(__pyx_v_force_type);

  /* "netif.pyx":1980
 *     keyword argument that sets force_type='bridge'.
 *     """
 *     typemap = None             # <<<<<<<<<<<<<<
 *     if kwargs.pop('bridge', False):
 *         force_type = 'bridge'
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_typemap = Py_None;

  /* "netif.pyx":1981
 *     """
 *     typemap = None
 *     if kwargs.pop('bridge', False):             # <<<<<<<<<<<<<<
 *         force_type = 'bridge'
 *     if kwargs:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "netif.pyx":1982
 *     typemap = None
 *     if kwargs.pop('bridge', False):
 *         force_type = 'bridge'             # <<<<<<<<<<<<<<
 *     if kwargs:
 *         raise TypeError('get_interface() got an unexpected keyword '
 */
    __Pyx_INCREF(__pyx_n_s_bridge);
    __Pyx_DECREF_SET(__pyx_v_force_type, __pyx_n_s_bridge);

    /* "netif.pyx":1981
 *     """
 *     typemap = None
 *     if kwargs.pop('bridge', False):             # <<<<<<<<<<<<<<
 *         force_type = 'bridge'
 *     if kwargs:
 */
  }

  /* "netif.pyx":1983
 *     if kwargs.pop('bridge', False):
 *         force_type = 'bridge'
 *     if kwargs:             # <<<<<<<<<<<<<<
 *         raise TypeError('get_interface() got an unexpected keyword '
 *                         'argument: ' + kwargs.popitem()[0])
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1983, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "netif.pyx":1985
 *     if kwargs:
 *         raise TypeError('get_interface() got an unexpected keyword '
 *                         'argument: ' + kwargs.popitem()[0])             # <<<<<<<<<<<<<<
 *     if force_type is not None:
 *         itype = {
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_popitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_get_interface_got_an_unexpected, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":1984
 *         force_type = 'bridge'
 *     if kwargs:
 *         raise TypeError('get_interface() got an unexpected keyword '             # <<<<<<<<<<<<<<
 *                         'argument: ' + kwargs.popitem()[0])
 *     if force_type is not None:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1984, __pyx_L1_error)

    /* "netif.pyx":1983
 *     if kwargs.pop('bridge', False):
 *         force_type = 'bridge'
 *     if kwargs:             # <<<<<<<<<<<<<<
 *         raise TypeError('get_interface() got an unexpected keyword '
 *                         'argument: ' + kwargs.popitem()[0])
 */
  }

  /* "netif.pyx":1986
 *         raise TypeError('get_interface() got an unexpected keyword '
 *                         'argument: ' + kwargs.popitem()[0])
 *     if force_type is not None:             # <<<<<<<<<<<<<<
 *         itype = {
 *             'vlan': VlanInterface,
 */
  __pyx_t_3 = (__pyx_v_force_type != Py_None);
  __pyx_t_5 = (__pyx_t_3 != 0);
  if (__pyx_t_5) {

    /* "netif.pyx":1988
 *     if force_type is not None:
 *         itype = {
 *             'vlan': VlanInterface,             # <<<<<<<<<<<<<<
 *             'lagg': LaggInterface,
 *             'bridge': BridgeInterface,
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vlan, ((PyObject *)__pyx_ptype_5netif_VlanInterface)) < 0) __PYX_ERR(0, 1988, __pyx_L1_error)

    /* "netif.pyx":1989
 *         itype = {
 *             'vlan': VlanInterface,
 *             'lagg': LaggInterface,             # <<<<<<<<<<<<<<
 *             'bridge': BridgeInterface,
 *         }[force_type]
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lagg, ((PyObject *)__pyx_ptype_5netif_LaggInterface)) < 0) __PYX_ERR(0, 1988, __pyx_L1_error)

    /* "netif.pyx":1990
 *             'vlan': VlanInterface,
 *             'lagg': LaggInterface,
 *             'bridge': BridgeInterface,             # <<<<<<<<<<<<<<
 *         }[force_type]
 *         typemap = {name: itype}
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bridge, ((PyObject *)__pyx_ptype_5netif_BridgeInterface)) < 0) __PYX_ERR(0, 1988, __pyx_L1_error)

    /* "netif.pyx":1991
 *             'lagg': LaggInterface,
 *             'bridge': BridgeInterface,
 *         }[force_type]             # <<<<<<<<<<<<<<
 *         typemap = {name: itype}
 *     return list_interfaces([name], typemap)[name]
 */
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_t_2, __pyx_v_force_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_itype = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "netif.pyx":1992
 *             'bridge': BridgeInterface,
 *         }[force_type]
 *         typemap = {name: itype}             # <<<<<<<<<<<<<<
 *     return list_interfaces([name], typemap)[name]
 * 
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_itype) < 0) __PYX_ERR(0, 1992, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_typemap, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "netif.pyx":1986
 *         raise TypeError('get_interface() got an unexpected keyword '
 *                         'argument: ' + kwargs.popitem()[0])
 *     if force_type is not None:             # <<<<<<<<<<<<<<
 *         itype = {
 *             'vlan': VlanInterface,
 */
  }

  /* "netif.pyx":1993
 *         }[force_type]
 *         typemap = {name: itype}
 *     return list_interfaces([name], typemap)[name]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_interfaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_typemap);
  __Pyx_GIVEREF(__pyx_v_typemap);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_typemap);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1970
 * 
 * 
 * def get_interface(name, force_type=None, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Get the given interface.  Raises KeyError if interface does
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("netif.get_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_typemap);
  __Pyx_XDECREF(__pyx_v_itype);
  __Pyx_XDECREF(__pyx_v_force_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":1996
 * 
 * 
 * def create_interface(name):             # <<<<<<<<<<<<<<
 *     """create new cloned interface (vlan, lagg, bridge)"""
 *     name = name.encode('ascii')
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_11create_interface(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_5netif_10create_interface[] = "create new cloned interface (vlan, lagg, bridge)";
static PyMethodDef __pyx_mdef_5netif_11create_interface = {"create_interface", (PyCFunction)__pyx_pw_5netif_11create_interface, METH_O, __pyx_doc_5netif_10create_interface};
static PyObject *__pyx_pw_5netif_11create_interface(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_interface (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_10create_interface(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_10create_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  struct ifreq __pyx_v_ifr;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  char const *__pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char *__pyx_t_17;
  __Pyx_RefNannySetupContext("create_interface", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "netif.pyx":1998
 * def create_interface(name):
 *     """create new cloned interface (vlan, lagg, bridge)"""
 *     name = name.encode('ascii')             # <<<<<<<<<<<<<<
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "netif.pyx":2000
 *     name = name.encode('ascii')
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sock3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2000, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_s = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "netif.pyx":2001
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         strcpy(ifr.ifr_name, name)             # <<<<<<<<<<<<<<
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
          __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 2001, __pyx_L7_error)
          strcpy(__pyx_v_ifr.ifr_name, __pyx_t_12);

          /* "netif.pyx":2002
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 *     return ifr.ifr_name.decode('ascii')
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2002, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (__pyx_t_1) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2002, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2002, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2002, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_14 = ((ioctl(__pyx_t_13, SIOCIFCREATE, ((void *)(&__pyx_v_ifr))) == -1L) != 0);
          if (__pyx_t_14) {

            /* "netif.pyx":2003
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 *     return ifr.ifr_name.decode('ascii')
 * 
 */
            __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2003, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2003, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2003, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2003, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
              }
            }
            if (!__pyx_t_4) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2003, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_t_2);
            } else {
              __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2003, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2003, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2003, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
            __pyx_t_7 = 0;
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2003, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 2003, __pyx_L7_error)

            /* "netif.pyx":2002
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 *     return ifr.ifr_name.decode('ascii')
 */
          }

          /* "netif.pyx":2000
 *     name = name.encode('ascii')
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("netif.create_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 2000, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2000, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (__pyx_t_14 < 0) __PYX_ERR(0, 2000, __pyx_L9_except_error)
          __pyx_t_16 = ((!(__pyx_t_14 != 0)) != 0);
          if (__pyx_t_16) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_5, __pyx_t_7);
            __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; 
            __PYX_ERR(0, 2000, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2000, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "netif.pyx":2004
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))
 *     return ifr.ifr_name.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_17 = __pyx_v_ifr.ifr_name;
  __pyx_t_7 = __Pyx_decode_c_string(__pyx_t_17, 0, strlen(__pyx_t_17), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "netif.pyx":1996
 * 
 * 
 * def create_interface(name):             # <<<<<<<<<<<<<<
 *     """create new cloned interface (vlan, lagg, bridge)"""
 *     name = name.encode('ascii')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.create_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":2007
 * 
 * 
 * def destroy_interface(name):             # <<<<<<<<<<<<<<
 *     """destroy specified interface (probably should only use on clones)"""
 *     name = name.encode('ascii')
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_13destroy_interface(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_5netif_12destroy_interface[] = "destroy specified interface (probably should only use on clones)";
static PyMethodDef __pyx_mdef_5netif_13destroy_interface = {"destroy_interface", (PyCFunction)__pyx_pw_5netif_13destroy_interface, METH_O, __pyx_doc_5netif_12destroy_interface};
static PyObject *__pyx_pw_5netif_13destroy_interface(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy_interface (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_12destroy_interface(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_12destroy_interface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  struct ifreq __pyx_v_ifr;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  char const *__pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char *__pyx_t_17;
  __Pyx_RefNannySetupContext("destroy_interface", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "netif.pyx":2009
 * def destroy_interface(name):
 *     """destroy specified interface (probably should only use on clones)"""
 *     name = name.encode('ascii')             # <<<<<<<<<<<<<<
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "netif.pyx":2011
 *     name = name.encode('ascii')
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sock3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2011, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {
          __pyx_v_s = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "netif.pyx":2012
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         strcpy(ifr.ifr_name, name)             # <<<<<<<<<<<<<<
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
          __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L7_error)
          strcpy(__pyx_v_ifr.ifr_name, __pyx_t_12);

          /* "netif.pyx":2013
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 *     return ifr.ifr_name.decode('ascii')
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (__pyx_t_1) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2013, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2013, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2013, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_14 = ((ioctl(__pyx_t_13, SIOCIFDESTROY, ((void *)(&__pyx_v_ifr))) == -1L) != 0);
          if (__pyx_t_14) {

            /* "netif.pyx":2014
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 *     return ifr.ifr_name.decode('ascii')
 * 
 */
            __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2014, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2014, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2014, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2014, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
              }
            }
            if (!__pyx_t_4) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_t_2);
            } else {
              __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2014, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2014, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
            __pyx_t_7 = 0;
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 2014, __pyx_L7_error)

            /* "netif.pyx":2013
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:             # <<<<<<<<<<<<<<
 *             raise OSError(errno, os.strerror(errno))
 *     return ifr.ifr_name.decode('ascii')
 */
          }

          /* "netif.pyx":2011
 *     name = name.encode('ascii')
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("netif.destroy_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 2011, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2011, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (__pyx_t_14 < 0) __PYX_ERR(0, 2011, __pyx_L9_except_error)
          __pyx_t_16 = ((!(__pyx_t_14 != 0)) != 0);
          if (__pyx_t_16) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_5, __pyx_t_7);
            __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; 
            __PYX_ERR(0, 2011, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__37, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "netif.pyx":2015
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:
 *             raise OSError(errno, os.strerror(errno))
 *     return ifr.ifr_name.decode('ascii')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_17 = __pyx_v_ifr.ifr_name;
  __pyx_t_7 = __Pyx_decode_c_string(__pyx_t_17, 0, strlen(__pyx_t_17), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "netif.pyx":2007
 * 
 * 
 * def destroy_interface(name):             # <<<<<<<<<<<<<<
 *     """destroy specified interface (probably should only use on clones)"""
 *     name = name.encode('ascii')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.destroy_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":2018
 * 
 * 
 * def get_hostname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_15get_hostname(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5netif_15get_hostname = {"get_hostname", (PyCFunction)__pyx_pw_5netif_15get_hostname, METH_NOARGS, 0};
static PyObject *__pyx_pw_5netif_15get_hostname(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_hostname (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_14get_hostname(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_14get_hostname(CYTHON_UNUSED PyObject *__pyx_self) {
  char __pyx_v_buf[_SC_HOST_NAME_MAX];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("get_hostname", 0);

  /* "netif.pyx":2021
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 *     if defs.gethostname(buf, cython.sizeof(buf)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_1 = ((gethostname(__pyx_v_buf, (sizeof(__pyx_v_buf))) != 0) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":2022
 * 
 *     if defs.gethostname(buf, cython.sizeof(buf)) != 0:
 *         raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     return buf
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2022, __pyx_L1_error)

    /* "netif.pyx":2021
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 *     if defs.gethostname(buf, cython.sizeof(buf)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":2024
 *         raise OSError(errno, os.strerror(errno))
 * 
 *     return buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":2018
 * 
 * 
 * def get_hostname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.get_hostname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":2027
 * 
 * 
 * def set_hostname(newhostname):             # <<<<<<<<<<<<<<
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_17set_hostname(PyObject *__pyx_self, PyObject *__pyx_v_newhostname); /*proto*/
static PyMethodDef __pyx_mdef_5netif_17set_hostname = {"set_hostname", (PyCFunction)__pyx_pw_5netif_17set_hostname, METH_O, 0};
static PyObject *__pyx_pw_5netif_17set_hostname(PyObject *__pyx_self, PyObject *__pyx_v_newhostname) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_hostname (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_16set_hostname(__pyx_self, ((PyObject *)__pyx_v_newhostname));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_16set_hostname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_newhostname) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("set_hostname", 0);
  __Pyx_INCREF(__pyx_v_newhostname);

  /* "netif.pyx":2028
 * 
 * def set_hostname(newhostname):
 *     newhostname = newhostname.encode('ascii')             # <<<<<<<<<<<<<<
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 *         raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newhostname, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_newhostname, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "netif.pyx":2029
 * def set_hostname(newhostname):
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_newhostname); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 2029, __pyx_L1_error)
  __pyx_t_4 = PyObject_Length(__pyx_v_newhostname); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __pyx_t_5 = ((sethostname(__pyx_t_3, __pyx_t_4) != 0) != 0);
  if (__pyx_t_5) {

    /* "netif.pyx":2030
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 *         raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2030, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2030, __pyx_L1_error)

    /* "netif.pyx":2029
 * def set_hostname(newhostname):
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":2027
 * 
 * 
 * def set_hostname(newhostname):             # <<<<<<<<<<<<<<
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.set_hostname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_newhostname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":2033
 * 
 * 
 * def get_domainname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_19get_domainname(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5netif_19get_domainname = {"get_domainname", (PyCFunction)__pyx_pw_5netif_19get_domainname, METH_NOARGS, 0};
static PyObject *__pyx_pw_5netif_19get_domainname(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_domainname (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_18get_domainname(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_18get_domainname(CYTHON_UNUSED PyObject *__pyx_self) {
  char __pyx_v_buf[_SC_HOST_NAME_MAX];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("get_domainname", 0);

  /* "netif.pyx":2036
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 *     if defs.getdomainname(buf, cython.sizeof(buf)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 * 
 */
  __pyx_t_1 = ((getdomainname(__pyx_v_buf, (sizeof(__pyx_v_buf))) != 0) != 0);
  if (__pyx_t_1) {

    /* "netif.pyx":2037
 * 
 *     if defs.getdomainname(buf, cython.sizeof(buf)) != 0:
 *         raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 * 
 *     return buf
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2037, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2037, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2037, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2037, __pyx_L1_error)

    /* "netif.pyx":2036
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 *     if defs.getdomainname(buf, cython.sizeof(buf)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 * 
 */
  }

  /* "netif.pyx":2039
 *         raise OSError(errno, os.strerror(errno))
 * 
 *     return buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "netif.pyx":2033
 * 
 * 
 * def get_domainname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("netif.get_domainname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "netif.pyx":2042
 * 
 * 
 * def set_domainname(newdomainname):             # <<<<<<<<<<<<<<
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5netif_21set_domainname(PyObject *__pyx_self, PyObject *__pyx_v_newdomainname); /*proto*/
static PyMethodDef __pyx_mdef_5netif_21set_domainname = {"set_domainname", (PyCFunction)__pyx_pw_5netif_21set_domainname, METH_O, 0};
static PyObject *__pyx_pw_5netif_21set_domainname(PyObject *__pyx_self, PyObject *__pyx_v_newdomainname) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_domainname (wrapper)", 0);
  __pyx_r = __pyx_pf_5netif_20set_domainname(__pyx_self, ((PyObject *)__pyx_v_newdomainname));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5netif_20set_domainname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_newdomainname) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("set_domainname", 0);
  __Pyx_INCREF(__pyx_v_newdomainname);

  /* "netif.pyx":2043
 * 
 * def set_domainname(newdomainname):
 *     newdomainname = newdomainname.encode('ascii')             # <<<<<<<<<<<<<<
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 *         raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newdomainname, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_newdomainname, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "netif.pyx":2044
 * def set_domainname(newdomainname):
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_newdomainname); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 2044, __pyx_L1_error)
  __pyx_t_4 = PyObject_Length(__pyx_v_newdomainname); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2044, __pyx_L1_error)
  __pyx_t_5 = ((setdomainname(__pyx_t_3, __pyx_t_4) != 0) != 0);
  if (__pyx_t_5) {

    /* "netif.pyx":2045
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 *         raise OSError(errno, os.strerror(errno))             # <<<<<<<<<<<<<<
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strerror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2045, __pyx_L1_error)

    /* "netif.pyx":2044
 * def set_domainname(newdomainname):
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:             # <<<<<<<<<<<<<<
 *         raise OSError(errno, os.strerror(errno))
 */
  }

  /* "netif.pyx":2042
 * 
 * 
 * def set_domainname(newdomainname):             # <<<<<<<<<<<<<<
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("netif.set_domainname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_newdomainname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_5netif_NetworkInterface __pyx_vtable_5netif_NetworkInterface;

static PyObject *__pyx_tp_new_5netif_NetworkInterface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5netif_NetworkInterface *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_NetworkInterface *)o);
  p->__pyx_vtab = __pyx_vtabptr_5netif_NetworkInterface;
  p->name = Py_None; Py_INCREF(Py_None);
  p->nameb = Py_None; Py_INCREF(Py_None);
  p->type = Py_None; Py_INCREF(Py_None);
  p->addresses = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5netif_NetworkInterface(PyObject *o) {
  struct __pyx_obj_5netif_NetworkInterface *p = (struct __pyx_obj_5netif_NetworkInterface *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  Py_CLEAR(p->nameb);
  Py_CLEAR(p->type);
  Py_CLEAR(p->addresses);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5netif_NetworkInterface(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif_NetworkInterface *p = (struct __pyx_obj_5netif_NetworkInterface *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  if (p->nameb) {
    e = (*v)(p->nameb, a); if (e) return e;
  }
  if (p->type) {
    e = (*v)(p->type, a); if (e) return e;
  }
  if (p->addresses) {
    e = (*v)(p->addresses, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif_NetworkInterface(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif_NetworkInterface *p = (struct __pyx_obj_5netif_NetworkInterface *)o;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->nameb);
  p->nameb = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->type);
  p->type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->addresses);
  p->addresses = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_cloned(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_6cloned_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_5flags_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_nd6_flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_9nd6_flags_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_nd6_flags(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_9nd6_flags_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_mtu(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_3mtu_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_mtu(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_3mtu_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_capabilities(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_12capabilities_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_capabilities(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_12capabilities_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_link_state(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_10link_state_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_link_address(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_12link_address_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_link_address(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_12link_address_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_media_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_10media_type_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_active_media_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_17active_media_type_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_media_subtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_13media_subtype_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_media_subtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_13media_subtype_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_active_media_subtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_20active_media_subtype_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_media_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_13media_options_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_media_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_13media_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_description(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_11description_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_description(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_11description_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_carp_config(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_11carp_config_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_carp_config(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_11carp_config_4__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_4name_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_4type_1__get__(o);
}

static int __pyx_setprop_5netif_16NetworkInterface_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_16NetworkInterface_4type_3__set__(o, v);
  }
  else {
    return __pyx_pw_5netif_16NetworkInterface_4type_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5netif_16NetworkInterface_addresses(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_16NetworkInterface_9addresses_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_NetworkInterface[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_7__getstate__, METH_NOARGS, 0},
  {"add_address", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_9add_address, METH_O, 0},
  {"remove_address", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_11remove_address, METH_O, 0},
  {"down", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_13down, METH_NOARGS, 0},
  {"up", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_15up, METH_NOARGS, 0},
  {"rename", (PyCFunction)__pyx_pw_5netif_16NetworkInterface_17rename, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_NetworkInterface[] = {
  {(char *)"cloned", __pyx_getprop_5netif_16NetworkInterface_cloned, 0, (char *)0, 0},
  {(char *)"flags", __pyx_getprop_5netif_16NetworkInterface_flags, 0, (char *)0, 0},
  {(char *)"nd6_flags", __pyx_getprop_5netif_16NetworkInterface_nd6_flags, __pyx_setprop_5netif_16NetworkInterface_nd6_flags, (char *)0, 0},
  {(char *)"mtu", __pyx_getprop_5netif_16NetworkInterface_mtu, __pyx_setprop_5netif_16NetworkInterface_mtu, (char *)0, 0},
  {(char *)"capabilities", __pyx_getprop_5netif_16NetworkInterface_capabilities, __pyx_setprop_5netif_16NetworkInterface_capabilities, (char *)0, 0},
  {(char *)"link_state", __pyx_getprop_5netif_16NetworkInterface_link_state, 0, (char *)0, 0},
  {(char *)"link_address", __pyx_getprop_5netif_16NetworkInterface_link_address, __pyx_setprop_5netif_16NetworkInterface_link_address, (char *)0, 0},
  {(char *)"media_type", __pyx_getprop_5netif_16NetworkInterface_media_type, 0, (char *)0, 0},
  {(char *)"active_media_type", __pyx_getprop_5netif_16NetworkInterface_active_media_type, 0, (char *)0, 0},
  {(char *)"media_subtype", __pyx_getprop_5netif_16NetworkInterface_media_subtype, __pyx_setprop_5netif_16NetworkInterface_media_subtype, (char *)0, 0},
  {(char *)"active_media_subtype", __pyx_getprop_5netif_16NetworkInterface_active_media_subtype, 0, (char *)0, 0},
  {(char *)"media_options", __pyx_getprop_5netif_16NetworkInterface_media_options, __pyx_setprop_5netif_16NetworkInterface_media_options, (char *)0, 0},
  {(char *)"description", __pyx_getprop_5netif_16NetworkInterface_description, __pyx_setprop_5netif_16NetworkInterface_description, (char *)0, 0},
  {(char *)"carp_config", __pyx_getprop_5netif_16NetworkInterface_carp_config, __pyx_setprop_5netif_16NetworkInterface_carp_config, (char *)0, 0},
  {(char *)"name", __pyx_getprop_5netif_16NetworkInterface_name, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_5netif_16NetworkInterface_type, __pyx_setprop_5netif_16NetworkInterface_type, (char *)0, 0},
  {(char *)"addresses", __pyx_getprop_5netif_16NetworkInterface_addresses, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_NetworkInterface = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.NetworkInterface", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_NetworkInterface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_NetworkInterface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_5netif_16NetworkInterface_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_5netif_16NetworkInterface_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_NetworkInterface, /*tp_traverse*/
  __pyx_tp_clear_5netif_NetworkInterface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_NetworkInterface, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_NetworkInterface, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5netif_16NetworkInterface_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_NetworkInterface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_LaggInterface __pyx_vtable_5netif_LaggInterface;

static PyObject *__pyx_tp_new_5netif_LaggInterface(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_LaggInterface *p;
  PyObject *o = __pyx_tp_new_5netif_NetworkInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_LaggInterface *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_NetworkInterface*)__pyx_vtabptr_5netif_LaggInterface;
  return o;
}

static PyObject *__pyx_getprop_5netif_13LaggInterface_protocol(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13LaggInterface_8protocol_1__get__(o);
}

static int __pyx_setprop_5netif_13LaggInterface_protocol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_13LaggInterface_8protocol_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_13LaggInterface_ports(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13LaggInterface_5ports_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_LaggInterface[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_13LaggInterface_1__getstate__, METH_NOARGS, 0},
  {"add_port", (PyCFunction)__pyx_pw_5netif_13LaggInterface_3add_port, METH_O, 0},
  {"delete_port", (PyCFunction)__pyx_pw_5netif_13LaggInterface_5delete_port, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_LaggInterface[] = {
  {(char *)"protocol", __pyx_getprop_5netif_13LaggInterface_protocol, __pyx_setprop_5netif_13LaggInterface_protocol, (char *)0, 0},
  {(char *)"ports", __pyx_getprop_5netif_13LaggInterface_ports, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_LaggInterface = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.LaggInterface", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_LaggInterface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_NetworkInterface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_5__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_NetworkInterface, /*tp_traverse*/
  __pyx_tp_clear_5netif_NetworkInterface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_LaggInterface, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_LaggInterface, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_LaggInterface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_BridgeInterface __pyx_vtable_5netif_BridgeInterface;

static PyObject *__pyx_tp_new_5netif_BridgeInterface(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_BridgeInterface *p;
  PyObject *o = __pyx_tp_new_5netif_NetworkInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_BridgeInterface *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_NetworkInterface*)__pyx_vtabptr_5netif_BridgeInterface;
  return o;
}

static PyObject *__pyx_getprop_5netif_15BridgeInterface_members(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_15BridgeInterface_7members_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_BridgeInterface[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_15BridgeInterface_1__getstate__, METH_NOARGS, 0},
  {"add_member", (PyCFunction)__pyx_pw_5netif_15BridgeInterface_3add_member, METH_O, 0},
  {"delete_member", (PyCFunction)__pyx_pw_5netif_15BridgeInterface_5delete_member, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_BridgeInterface[] = {
  {(char *)"members", __pyx_getprop_5netif_15BridgeInterface_members, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_BridgeInterface = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.BridgeInterface", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_BridgeInterface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_NetworkInterface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_5__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_NetworkInterface, /*tp_traverse*/
  __pyx_tp_clear_5netif_NetworkInterface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_BridgeInterface, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_BridgeInterface, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_BridgeInterface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_VlanInterface __pyx_vtable_5netif_VlanInterface;

static PyObject *__pyx_tp_new_5netif_VlanInterface(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_VlanInterface *p;
  PyObject *o = __pyx_tp_new_5netif_NetworkInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_VlanInterface *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_NetworkInterface*)__pyx_vtabptr_5netif_VlanInterface;
  return o;
}

static PyObject *__pyx_getprop_5netif_13VlanInterface_parent(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13VlanInterface_6parent_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_13VlanInterface_tag(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13VlanInterface_3tag_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_VlanInterface[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_13VlanInterface_1__getstate__, METH_NOARGS, 0},
  {"configure", (PyCFunction)__pyx_pw_5netif_13VlanInterface_3configure, METH_VARARGS|METH_KEYWORDS, 0},
  {"unconfigure", (PyCFunction)__pyx_pw_5netif_13VlanInterface_5unconfigure, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_VlanInterface[] = {
  {(char *)"parent", __pyx_getprop_5netif_13VlanInterface_parent, 0, (char *)0, 0},
  {(char *)"tag", __pyx_getprop_5netif_13VlanInterface_tag, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_VlanInterface = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.VlanInterface", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_VlanInterface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_NetworkInterface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_5__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_3__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_NetworkInterface, /*tp_traverse*/
  __pyx_tp_clear_5netif_NetworkInterface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_VlanInterface, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_VlanInterface, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_5netif_16NetworkInterface_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_VlanInterface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_RoutingPacket __pyx_vtable_5netif_RoutingPacket;

static PyObject *__pyx_tp_new_5netif_RoutingPacket(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5netif_RoutingPacket *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_RoutingPacket *)o);
  p->__pyx_vtab = __pyx_vtabptr_5netif_RoutingPacket;
  p->data = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5netif_RoutingPacket(PyObject *o) {
  struct __pyx_obj_5netif_RoutingPacket *p = (struct __pyx_obj_5netif_RoutingPacket *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->data);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5netif_RoutingPacket(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif_RoutingPacket *p = (struct __pyx_obj_5netif_RoutingPacket *)o;
  if (p->data) {
    e = (*v)(p->data, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif_RoutingPacket(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif_RoutingPacket *p = (struct __pyx_obj_5netif_RoutingPacket *)o;
  tmp = ((PyObject*)p->data);
  p->data = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5netif_13RoutingPacket_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13RoutingPacket_4type_1__get__(o);
}

static int __pyx_setprop_5netif_13RoutingPacket_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_13RoutingPacket_4type_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_13RoutingPacket_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13RoutingPacket_7version_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_13RoutingPacket_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13RoutingPacket_6length_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_13RoutingPacket_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_13RoutingPacket_4data_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_RoutingPacket[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_13RoutingPacket_3__getstate__, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_RoutingPacket[] = {
  {(char *)"type", __pyx_getprop_5netif_13RoutingPacket_type, __pyx_setprop_5netif_13RoutingPacket_type, (char *)0, 0},
  {(char *)"version", __pyx_getprop_5netif_13RoutingPacket_version, 0, (char *)0, 0},
  {(char *)"length", __pyx_getprop_5netif_13RoutingPacket_length, 0, (char *)0, 0},
  {(char *)"data", __pyx_getprop_5netif_13RoutingPacket_data, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_RoutingPacket = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.RoutingPacket", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_RoutingPacket), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_RoutingPacket, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_RoutingPacket, /*tp_traverse*/
  __pyx_tp_clear_5netif_RoutingPacket, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_RoutingPacket, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_RoutingPacket, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5netif_13RoutingPacket_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_RoutingPacket, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_InterfaceAnnounceMessage __pyx_vtable_5netif_InterfaceAnnounceMessage;

static PyObject *__pyx_tp_new_5netif_InterfaceAnnounceMessage(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_InterfaceAnnounceMessage *p;
  PyObject *o = __pyx_tp_new_5netif_RoutingPacket(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_InterfaceAnnounceMessage *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_RoutingPacket*)__pyx_vtabptr_5netif_InterfaceAnnounceMessage;
  return o;
}

static PyObject *__pyx_getprop_5netif_24InterfaceAnnounceMessage_interface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_24InterfaceAnnounceMessage_9interface_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_24InterfaceAnnounceMessage_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_24InterfaceAnnounceMessage_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_InterfaceAnnounceMessage[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_24InterfaceAnnounceMessage_3__getstate__, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_InterfaceAnnounceMessage[] = {
  {(char *)"interface", __pyx_getprop_5netif_24InterfaceAnnounceMessage_interface, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_5netif_24InterfaceAnnounceMessage_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_InterfaceAnnounceMessage = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.InterfaceAnnounceMessage", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_InterfaceAnnounceMessage), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_RoutingPacket, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_RoutingPacket, /*tp_traverse*/
  __pyx_tp_clear_5netif_RoutingPacket, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_InterfaceAnnounceMessage, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_InterfaceAnnounceMessage, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5netif_24InterfaceAnnounceMessage_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_InterfaceAnnounceMessage, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_InterfaceInfoMessage __pyx_vtable_5netif_InterfaceInfoMessage;

static PyObject *__pyx_tp_new_5netif_InterfaceInfoMessage(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_InterfaceInfoMessage *p;
  PyObject *o = __pyx_tp_new_5netif_RoutingPacket(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_InterfaceInfoMessage *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_RoutingPacket*)__pyx_vtabptr_5netif_InterfaceInfoMessage;
  p->addrs = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5netif_InterfaceInfoMessage(PyObject *o) {
  struct __pyx_obj_5netif_InterfaceInfoMessage *p = (struct __pyx_obj_5netif_InterfaceInfoMessage *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->addrs);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5netif_RoutingPacket(o);
}

static int __pyx_tp_traverse_5netif_InterfaceInfoMessage(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif_InterfaceInfoMessage *p = (struct __pyx_obj_5netif_InterfaceInfoMessage *)o;
  e = __pyx_tp_traverse_5netif_RoutingPacket(o, v, a); if (e) return e;
  if (p->addrs) {
    e = (*v)(p->addrs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif_InterfaceInfoMessage(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif_InterfaceInfoMessage *p = (struct __pyx_obj_5netif_InterfaceInfoMessage *)o;
  __pyx_tp_clear_5netif_RoutingPacket(o);
  tmp = ((PyObject*)p->addrs);
  p->addrs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5netif_20InterfaceInfoMessage_flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceInfoMessage_5flags_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceInfoMessage_link_state(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceInfoMessage_10link_state_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceInfoMessage_mtu(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceInfoMessage_3mtu_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceInfoMessage_interface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceInfoMessage_9interface_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceInfoMessage_addrs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceInfoMessage_5addrs_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_InterfaceInfoMessage[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_20InterfaceInfoMessage_3__getstate__, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_InterfaceInfoMessage[] = {
  {(char *)"flags", __pyx_getprop_5netif_20InterfaceInfoMessage_flags, 0, (char *)0, 0},
  {(char *)"link_state", __pyx_getprop_5netif_20InterfaceInfoMessage_link_state, 0, (char *)0, 0},
  {(char *)"mtu", __pyx_getprop_5netif_20InterfaceInfoMessage_mtu, 0, (char *)0, 0},
  {(char *)"interface", __pyx_getprop_5netif_20InterfaceInfoMessage_interface, 0, (char *)0, 0},
  {(char *)"addrs", __pyx_getprop_5netif_20InterfaceInfoMessage_addrs, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_InterfaceInfoMessage = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.InterfaceInfoMessage", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_InterfaceInfoMessage), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_InterfaceInfoMessage, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_InterfaceInfoMessage, /*tp_traverse*/
  __pyx_tp_clear_5netif_InterfaceInfoMessage, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_InterfaceInfoMessage, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_InterfaceInfoMessage, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5netif_20InterfaceInfoMessage_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_InterfaceInfoMessage, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_InterfaceAddrMessage __pyx_vtable_5netif_InterfaceAddrMessage;

static PyObject *__pyx_tp_new_5netif_InterfaceAddrMessage(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_InterfaceAddrMessage *p;
  PyObject *o = __pyx_tp_new_5netif_RoutingPacket(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_InterfaceAddrMessage *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_RoutingPacket*)__pyx_vtabptr_5netif_InterfaceAddrMessage;
  p->addrs = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5netif_InterfaceAddrMessage(PyObject *o) {
  struct __pyx_obj_5netif_InterfaceAddrMessage *p = (struct __pyx_obj_5netif_InterfaceAddrMessage *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->addrs);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5netif_RoutingPacket(o);
}

static int __pyx_tp_traverse_5netif_InterfaceAddrMessage(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif_InterfaceAddrMessage *p = (struct __pyx_obj_5netif_InterfaceAddrMessage *)o;
  e = __pyx_tp_traverse_5netif_RoutingPacket(o, v, a); if (e) return e;
  if (p->addrs) {
    e = (*v)(p->addrs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif_InterfaceAddrMessage(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif_InterfaceAddrMessage *p = (struct __pyx_obj_5netif_InterfaceAddrMessage *)o;
  __pyx_tp_clear_5netif_RoutingPacket(o);
  tmp = ((PyObject*)p->addrs);
  p->addrs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5netif_20InterfaceAddrMessage_address(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceAddrMessage_7address_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceAddrMessage_netmask(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceAddrMessage_7netmask_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceAddrMessage_dest_address(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceAddrMessage_12dest_address_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceAddrMessage_flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceAddrMessage_5flags_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceAddrMessage_interface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceAddrMessage_9interface_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_20InterfaceAddrMessage_addrs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_20InterfaceAddrMessage_5addrs_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_InterfaceAddrMessage[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_20InterfaceAddrMessage_3__getstate__, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_InterfaceAddrMessage[] = {
  {(char *)"address", __pyx_getprop_5netif_20InterfaceAddrMessage_address, 0, (char *)0, 0},
  {(char *)"netmask", __pyx_getprop_5netif_20InterfaceAddrMessage_netmask, 0, (char *)0, 0},
  {(char *)"dest_address", __pyx_getprop_5netif_20InterfaceAddrMessage_dest_address, 0, (char *)0, 0},
  {(char *)"flags", __pyx_getprop_5netif_20InterfaceAddrMessage_flags, 0, (char *)0, 0},
  {(char *)"interface", __pyx_getprop_5netif_20InterfaceAddrMessage_interface, 0, (char *)0, 0},
  {(char *)"addrs", __pyx_getprop_5netif_20InterfaceAddrMessage_addrs, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_InterfaceAddrMessage = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.InterfaceAddrMessage", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_InterfaceAddrMessage), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_InterfaceAddrMessage, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_InterfaceAddrMessage, /*tp_traverse*/
  __pyx_tp_clear_5netif_InterfaceAddrMessage, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_InterfaceAddrMessage, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_InterfaceAddrMessage, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5netif_20InterfaceAddrMessage_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_InterfaceAddrMessage, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5netif_RoutingMessage __pyx_vtable_5netif_RoutingMessage;

static PyObject *__pyx_tp_new_5netif_RoutingMessage(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5netif_RoutingMessage *p;
  PyObject *o = __pyx_tp_new_5netif_RoutingPacket(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5netif_RoutingMessage *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5netif_RoutingPacket*)__pyx_vtabptr_5netif_RoutingMessage;
  p->addrs = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5netif_RoutingMessage(PyObject *o) {
  struct __pyx_obj_5netif_RoutingMessage *p = (struct __pyx_obj_5netif_RoutingMessage *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5netif_14RoutingMessage_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->addrs);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5netif_RoutingPacket(o);
}

static int __pyx_tp_traverse_5netif_RoutingMessage(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif_RoutingMessage *p = (struct __pyx_obj_5netif_RoutingMessage *)o;
  e = __pyx_tp_traverse_5netif_RoutingPacket(o, v, a); if (e) return e;
  if (p->addrs) {
    e = (*v)(p->addrs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif_RoutingMessage(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif_RoutingMessage *p = (struct __pyx_obj_5netif_RoutingMessage *)o;
  __pyx_tp_clear_5netif_RoutingPacket(o);
  tmp = ((PyObject*)p->addrs);
  p->addrs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_errno(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_5errno_1__get__(o);
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_5flags_1__get__(o);
}

static int __pyx_setprop_5netif_14RoutingMessage_flags(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_14RoutingMessage_5flags_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_interface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_9interface_1__get__(o);
}

static int __pyx_setprop_5netif_14RoutingMessage_interface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_14RoutingMessage_9interface_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_network(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_7network_1__get__(o);
}

static int __pyx_setprop_5netif_14RoutingMessage_network(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_14RoutingMessage_7network_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_netmask(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_7netmask_1__get__(o);
}

static int __pyx_setprop_5netif_14RoutingMessage_netmask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_14RoutingMessage_7netmask_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_gateway(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_7gateway_1__get__(o);
}

static int __pyx_setprop_5netif_14RoutingMessage_gateway(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_14RoutingMessage_7gateway_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_route(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_5route_1__get__(o);
}

static int __pyx_setprop_5netif_14RoutingMessage_route(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5netif_14RoutingMessage_5route_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5netif_14RoutingMessage_addrs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5netif_14RoutingMessage_5addrs_1__get__(o);
}

static PyMethodDef __pyx_methods_5netif_RoutingMessage[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5netif_14RoutingMessage_5__getstate__, METH_NOARGS, 0},
  {"as_buffer", (PyCFunction)__pyx_pw_5netif_14RoutingMessage_7as_buffer, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5netif_RoutingMessage[] = {
  {(char *)"errno", __pyx_getprop_5netif_14RoutingMessage_errno, 0, (char *)0, 0},
  {(char *)"flags", __pyx_getprop_5netif_14RoutingMessage_flags, __pyx_setprop_5netif_14RoutingMessage_flags, (char *)0, 0},
  {(char *)"interface", __pyx_getprop_5netif_14RoutingMessage_interface, __pyx_setprop_5netif_14RoutingMessage_interface, (char *)0, 0},
  {(char *)"network", __pyx_getprop_5netif_14RoutingMessage_network, __pyx_setprop_5netif_14RoutingMessage_network, (char *)0, 0},
  {(char *)"netmask", __pyx_getprop_5netif_14RoutingMessage_netmask, __pyx_setprop_5netif_14RoutingMessage_netmask, (char *)0, 0},
  {(char *)"gateway", __pyx_getprop_5netif_14RoutingMessage_gateway, __pyx_setprop_5netif_14RoutingMessage_gateway, (char *)0, 0},
  {(char *)"route", __pyx_getprop_5netif_14RoutingMessage_route, __pyx_setprop_5netif_14RoutingMessage_route, (char *)0, 0},
  {(char *)"addrs", __pyx_getprop_5netif_14RoutingMessage_addrs, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5netif_RoutingMessage = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.RoutingMessage", /*tp_name*/
  sizeof(struct __pyx_obj_5netif_RoutingMessage), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif_RoutingMessage, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif_RoutingMessage, /*tp_traverse*/
  __pyx_tp_clear_5netif_RoutingMessage, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5netif_RoutingMessage, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5netif_RoutingMessage, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5netif_14RoutingMessage_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif_RoutingMessage, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct____get__ *__pyx_freelist_5netif___pyx_scope_struct____get__[8];
static int __pyx_freecount_5netif___pyx_scope_struct____get__ = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct____get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct____get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct____get__)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct____get__[--__pyx_freecount_5netif___pyx_scope_struct____get__];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct____get__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct____get__(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct____get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct____get__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_addr);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_vhid_map);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct____get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct____get__)))) {
    __pyx_freelist_5netif___pyx_scope_struct____get__[__pyx_freecount_5netif___pyx_scope_struct____get__++] = ((struct __pyx_obj_5netif___pyx_scope_struct____get__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct____get__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct____get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct____get__ *)o;
  if (p->__pyx_v_addr) {
    e = (*v)(p->__pyx_v_addr, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_vhid_map) {
    e = (*v)(p->__pyx_v_vhid_map, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct____get__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct____get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct____get__ *)o;
  tmp = ((PyObject*)p->__pyx_v_addr);
  p->__pyx_v_addr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_5netif_NetworkInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_vhid_map);
  p->__pyx_v_vhid_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct____get__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct____get__", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct____get__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct____get__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct____get__, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct____get__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct____get__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *__pyx_freelist_5netif___pyx_scope_struct_1___get__[8];
static int __pyx_freecount_5netif___pyx_scope_struct_1___get__ = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_1___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct_1___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_1___get__)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct_1___get__[--__pyx_freecount_5netif___pyx_scope_struct_1___get__];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct_1___get__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct_1___get__(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct_1___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_1___get__)))) {
    __pyx_freelist_5netif___pyx_scope_struct_1___get__[__pyx_freecount_5netif___pyx_scope_struct_1___get__++] = ((struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct_1___get__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct_1___get__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct_1___get__ *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_5netif_LaggInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct_1___get__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct_1___get__", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct_1___get__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct_1___get__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct_1___get__, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct_1___get__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct_1___get__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *__pyx_freelist_5netif___pyx_scope_struct_2___get__[8];
static int __pyx_freecount_5netif___pyx_scope_struct_2___get__ = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_2___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct_2___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_2___get__)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct_2___get__[--__pyx_freecount_5netif___pyx_scope_struct_2___get__];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct_2___get__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct_2___get__(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct_2___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_2___get__)))) {
    __pyx_freelist_5netif___pyx_scope_struct_2___get__[__pyx_freecount_5netif___pyx_scope_struct_2___get__++] = ((struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct_2___get__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct_2___get__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *p = (struct __pyx_obj_5netif___pyx_scope_struct_2___get__ *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_5netif_BridgeInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct_2___get__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct_2___get__", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct_2___get__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct_2___get__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct_2___get__, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct_2___get__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct_2___get__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct_3_routes *__pyx_freelist_5netif___pyx_scope_struct_3_routes[8];
static int __pyx_freecount_5netif___pyx_scope_struct_3_routes = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_3_routes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct_3_routes > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_3_routes)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct_3_routes[--__pyx_freecount_5netif___pyx_scope_struct_3_routes];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct_3_routes));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct_3_routes(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct_3_routes *p = (struct __pyx_obj_5netif___pyx_scope_struct_3_routes *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_data);
  Py_CLEAR(p->__pyx_v_msg);
  Py_CLEAR(p->__pyx_v_ptr);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct_3_routes < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_3_routes)))) {
    __pyx_freelist_5netif___pyx_scope_struct_3_routes[__pyx_freecount_5netif___pyx_scope_struct_3_routes++] = ((struct __pyx_obj_5netif___pyx_scope_struct_3_routes *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct_3_routes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct_3_routes *p = (struct __pyx_obj_5netif___pyx_scope_struct_3_routes *)o;
  if (p->__pyx_v_data) {
    e = (*v)(p->__pyx_v_data, a); if (e) return e;
  }
  if (p->__pyx_v_msg) {
    e = (*v)(((PyObject*)p->__pyx_v_msg), a); if (e) return e;
  }
  if (p->__pyx_v_ptr) {
    e = (*v)(p->__pyx_v_ptr, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct_3_routes(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct_3_routes *p = (struct __pyx_obj_5netif___pyx_scope_struct_3_routes *)o;
  tmp = ((PyObject*)p->__pyx_v_data);
  p->__pyx_v_data = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_msg);
  p->__pyx_v_msg = ((struct __pyx_obj_5netif_RoutingMessage *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ptr);
  p->__pyx_v_ptr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct_3_routes = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct_3_routes", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct_3_routes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct_3_routes, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct_3_routes, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct_3_routes, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct_3_routes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *__pyx_freelist_5netif___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_5netif___pyx_scope_struct_4_genexpr = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct_4_genexpr[--__pyx_freecount_5netif___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_5netif___pyx_scope_struct_4_genexpr[__pyx_freecount_5netif___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct_4_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct_4_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *__pyx_freelist_5netif___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_5netif___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct_5_genexpr[--__pyx_freecount_5netif___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_5netif___pyx_scope_struct_5_genexpr[__pyx_freecount_5netif___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct_5_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct_5_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *__pyx_freelist_5netif___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_5netif___pyx_scope_struct_6_genexpr = 0;

static PyObject *__pyx_tp_new_5netif___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5netif___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5netif___pyx_scope_struct_6_genexpr[--__pyx_freecount_5netif___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5netif___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5netif___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_5netif___pyx_scope_struct_6_genexpr[__pyx_freecount_5netif___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5netif___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5netif___pyx_scope_struct_6_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5netif___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "netif.__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5netif___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5netif___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5netif___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  __pyx_tp_clear_5netif___pyx_scope_struct_6_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5netif___pyx_scope_struct_6_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "netif",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_0_02x, __pyx_k_0_02x, sizeof(__pyx_k_0_02x), 0, 0, 1, 0},
  {&__pyx_kp_u_0_0_0_0, __pyx_k_0_0_0_0, sizeof(__pyx_k_0_0_0_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 1, 0, 0},
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_A12MPPSWITCH, __pyx_k_A12MPPSWITCH, sizeof(__pyx_k_A12MPPSWITCH), 0, 0, 1, 1},
  {&__pyx_n_s_AAL2, __pyx_k_AAL2, sizeof(__pyx_k_AAL2), 0, 0, 1, 1},
  {&__pyx_n_s_AAL5, __pyx_k_AAL5, sizeof(__pyx_k_AAL5), 0, 0, 1, 1},
  {&__pyx_n_s_ACCEPT_RTADV, __pyx_k_ACCEPT_RTADV, sizeof(__pyx_k_ACCEPT_RTADV), 0, 0, 1, 1},
  {&__pyx_n_s_ACTIVE, __pyx_k_ACTIVE, sizeof(__pyx_k_ACTIVE), 0, 0, 1, 1},
  {&__pyx_n_s_ADD, __pyx_k_ADD, sizeof(__pyx_k_ADD), 0, 0, 1, 1},
  {&__pyx_n_s_ADSL, __pyx_k_ADSL, sizeof(__pyx_k_ADSL), 0, 0, 1, 1},
  {&__pyx_n_s_AFLANE8023, __pyx_k_AFLANE8023, sizeof(__pyx_k_AFLANE8023), 0, 0, 1, 1},
  {&__pyx_n_s_AFLANE8025, __pyx_k_AFLANE8025, sizeof(__pyx_k_AFLANE8025), 0, 0, 1, 1},
  {&__pyx_n_s_AF_INET, __pyx_k_AF_INET, sizeof(__pyx_k_AF_INET), 0, 0, 1, 1},
  {&__pyx_n_s_AF_INET6, __pyx_k_AF_INET6, sizeof(__pyx_k_AF_INET6), 0, 0, 1, 1},
  {&__pyx_n_s_AF_ROUTE, __pyx_k_AF_ROUTE, sizeof(__pyx_k_AF_ROUTE), 0, 0, 1, 1},
  {&__pyx_n_s_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 0, 1, 1},
  {&__pyx_n_s_ALLMULTI, __pyx_k_ALLMULTI, sizeof(__pyx_k_ALLMULTI), 0, 0, 1, 1},
  {&__pyx_n_s_ANYCAST, __pyx_k_ANYCAST, sizeof(__pyx_k_ANYCAST), 0, 0, 1, 1},
  {&__pyx_n_s_APPLETALK, __pyx_k_APPLETALK, sizeof(__pyx_k_APPLETALK), 0, 0, 1, 1},
  {&__pyx_n_s_ARAP, __pyx_k_ARAP, sizeof(__pyx_k_ARAP), 0, 0, 1, 1},
  {&__pyx_n_s_ARCNET, __pyx_k_ARCNET, sizeof(__pyx_k_ARCNET), 0, 0, 1, 1},
  {&__pyx_n_s_ARCNETPLUS, __pyx_k_ARCNETPLUS, sizeof(__pyx_k_ARCNETPLUS), 0, 0, 1, 1},
  {&__pyx_n_s_ARP, __pyx_k_ARP, sizeof(__pyx_k_ARP), 0, 0, 1, 1},
  {&__pyx_n_s_ARRIVAL, __pyx_k_ARRIVAL, sizeof(__pyx_k_ARRIVAL), 0, 0, 1, 1},
  {&__pyx_n_s_ASYNC, __pyx_k_ASYNC, sizeof(__pyx_k_ASYNC), 0, 0, 1, 1},
  {&__pyx_n_s_ATM, __pyx_k_ATM, sizeof(__pyx_k_ATM), 0, 0, 1, 1},
  {&__pyx_n_s_ATMDXI, __pyx_k_ATMDXI, sizeof(__pyx_k_ATMDXI), 0, 0, 1, 1},
  {&__pyx_n_s_ATMFUNI, __pyx_k_ATMFUNI, sizeof(__pyx_k_ATMFUNI), 0, 0, 1, 1},
  {&__pyx_n_s_ATMIMA, __pyx_k_ATMIMA, sizeof(__pyx_k_ATMIMA), 0, 0, 1, 1},
  {&__pyx_n_s_ATMLOGICAL, __pyx_k_ATMLOGICAL, sizeof(__pyx_k_ATMLOGICAL), 0, 0, 1, 1},
  {&__pyx_n_s_ATMRADIO, __pyx_k_ATMRADIO, sizeof(__pyx_k_ATMRADIO), 0, 0, 1, 1},
  {&__pyx_n_s_ATMSUBINTERFACE, __pyx_k_ATMSUBINTERFACE, sizeof(__pyx_k_ATMSUBINTERFACE), 0, 0, 1, 1},
  {&__pyx_n_s_ATMVCIENDPT, __pyx_k_ATMVCIENDPT, sizeof(__pyx_k_ATMVCIENDPT), 0, 0, 1, 1},
  {&__pyx_n_s_ATMVIRTUAL, __pyx_k_ATMVIRTUAL, sizeof(__pyx_k_ATMVIRTUAL), 0, 0, 1, 1},
  {&__pyx_n_s_AUTO, __pyx_k_AUTO, sizeof(__pyx_k_AUTO), 0, 0, 1, 1},
  {&__pyx_n_s_AUTOCONF, __pyx_k_AUTOCONF, sizeof(__pyx_k_AUTOCONF), 0, 0, 1, 1},
  {&__pyx_n_s_AUTO_LINKLOCAL, __pyx_k_AUTO_LINKLOCAL, sizeof(__pyx_k_AUTO_LINKLOCAL), 0, 0, 1, 1},
  {&__pyx_n_s_AddressFamily, __pyx_k_AddressFamily, sizeof(__pyx_k_AddressFamily), 0, 0, 1, 1},
  {&__pyx_n_s_AggregationProtocol, __pyx_k_AggregationProtocol, sizeof(__pyx_k_AggregationProtocol), 0, 0, 1, 1},
  {&__pyx_n_s_BACKUP, __pyx_k_BACKUP, sizeof(__pyx_k_BACKUP), 0, 0, 1, 1},
  {&__pyx_n_s_BGPPOLICYACCOUNTING, __pyx_k_BGPPOLICYACCOUNTING, sizeof(__pyx_k_BGPPOLICYACCOUNTING), 0, 0, 1, 1},
  {&__pyx_n_s_BLACKHOLE, __pyx_k_BLACKHOLE, sizeof(__pyx_k_BLACKHOLE), 0, 0, 1, 1},
  {&__pyx_n_s_BLUETOOTH, __pyx_k_BLUETOOTH, sizeof(__pyx_k_BLUETOOTH), 0, 0, 1, 1},
  {&__pyx_n_s_BRIDGE, __pyx_k_BRIDGE, sizeof(__pyx_k_BRIDGE), 0, 0, 1, 1},
  {&__pyx_n_s_BROADCAST, __pyx_k_BROADCAST, sizeof(__pyx_k_BROADCAST), 0, 0, 1, 1},
  {&__pyx_n_s_BSC, __pyx_k_BSC, sizeof(__pyx_k_BSC), 0, 0, 1, 1},
  {&__pyx_n_s_BridgeInterface___get, __pyx_k_BridgeInterface___get, sizeof(__pyx_k_BridgeInterface___get), 0, 0, 1, 1},
  {&__pyx_n_s_CANTCONFIG, __pyx_k_CANTCONFIG, sizeof(__pyx_k_CANTCONFIG), 0, 0, 1, 1},
  {&__pyx_n_s_CCITT, __pyx_k_CCITT, sizeof(__pyx_k_CCITT), 0, 0, 1, 1},
  {&__pyx_n_s_CCTEMUL, __pyx_k_CCTEMUL, sizeof(__pyx_k_CCTEMUL), 0, 0, 1, 1},
  {&__pyx_n_s_CEPT, __pyx_k_CEPT, sizeof(__pyx_k_CEPT), 0, 0, 1, 1},
  {&__pyx_n_s_CES, __pyx_k_CES, sizeof(__pyx_k_CES), 0, 0, 1, 1},
  {&__pyx_n_s_CHANGE, __pyx_k_CHANGE, sizeof(__pyx_k_CHANGE), 0, 0, 1, 1},
  {&__pyx_n_s_CHANNEL, __pyx_k_CHANNEL, sizeof(__pyx_k_CHANNEL), 0, 0, 1, 1},
  {&__pyx_n_s_CHAOS, __pyx_k_CHAOS, sizeof(__pyx_k_CHAOS), 0, 0, 1, 1},
  {&__pyx_n_s_CLONED_PREFIXES, __pyx_k_CLONED_PREFIXES, sizeof(__pyx_k_CLONED_PREFIXES), 0, 0, 1, 1},
  {&__pyx_n_s_CNR, __pyx_k_CNR, sizeof(__pyx_k_CNR), 0, 0, 1, 1},
  {&__pyx_n_s_CNT, __pyx_k_CNT, sizeof(__pyx_k_CNT), 0, 0, 1, 1},
  {&__pyx_n_s_COFFEE, __pyx_k_COFFEE, sizeof(__pyx_k_COFFEE), 0, 0, 1, 1},
  {&__pyx_n_s_COIP, __pyx_k_COIP, sizeof(__pyx_k_COIP), 0, 0, 1, 1},
  {&__pyx_n_s_COLLECTING, __pyx_k_COLLECTING, sizeof(__pyx_k_COLLECTING), 0, 0, 1, 1},
  {&__pyx_n_s_COMPOSITELINK, __pyx_k_COMPOSITELINK, sizeof(__pyx_k_COMPOSITELINK), 0, 0, 1, 1},
  {&__pyx_n_s_CarpConfig, __pyx_k_CarpConfig, sizeof(__pyx_k_CarpConfig), 0, 0, 1, 1},
  {&__pyx_n_s_CarpConfig___init, __pyx_k_CarpConfig___init, sizeof(__pyx_k_CarpConfig___init), 0, 0, 1, 1},
  {&__pyx_n_s_CarpState, __pyx_k_CarpState, sizeof(__pyx_k_CarpState), 0, 0, 1, 1},
  {&__pyx_n_s_DATAKIT, __pyx_k_DATAKIT, sizeof(__pyx_k_DATAKIT), 0, 0, 1, 1},
  {&__pyx_n_s_DCN, __pyx_k_DCN, sizeof(__pyx_k_DCN), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG, __pyx_k_DEBUG, sizeof(__pyx_k_DEBUG), 0, 0, 1, 1},
  {&__pyx_n_s_DECnet, __pyx_k_DECnet, sizeof(__pyx_k_DECnet), 0, 0, 1, 1},
  {&__pyx_n_s_DELADDR, __pyx_k_DELADDR, sizeof(__pyx_k_DELADDR), 0, 0, 1, 1},
  {&__pyx_n_s_DELETE, __pyx_k_DELETE, sizeof(__pyx_k_DELETE), 0, 0, 1, 1},
  {&__pyx_n_s_DELMADDR, __pyx_k_DELMADDR, sizeof(__pyx_k_DELMADDR), 0, 0, 1, 1},
  {&__pyx_n_s_DEPARTURE, __pyx_k_DEPARTURE, sizeof(__pyx_k_DEPARTURE), 0, 0, 1, 1},
  {&__pyx_n_s_DEPRECATED, __pyx_k_DEPRECATED, sizeof(__pyx_k_DEPRECATED), 0, 0, 1, 1},
  {&__pyx_n_s_DETACHED, __pyx_k_DETACHED, sizeof(__pyx_k_DETACHED), 0, 0, 1, 1},
  {&__pyx_n_s_DIGITALPOWERLINE, __pyx_k_DIGITALPOWERLINE, sizeof(__pyx_k_DIGITALPOWERLINE), 0, 0, 1, 1},
  {&__pyx_n_s_DIGITALWRAPPEROVERHEADCHANNEL, __pyx_k_DIGITALWRAPPEROVERHEADCHANNEL, sizeof(__pyx_k_DIGITALWRAPPEROVERHEADCHANNEL), 0, 0, 1, 1},
  {&__pyx_n_s_DISABLED, __pyx_k_DISABLED, sizeof(__pyx_k_DISABLED), 0, 0, 1, 1},
  {&__pyx_n_s_DISTRIBUTING, __pyx_k_DISTRIBUTING, sizeof(__pyx_k_DISTRIBUTING), 0, 0, 1, 1},
  {&__pyx_n_s_DLI, __pyx_k_DLI, sizeof(__pyx_k_DLI), 0, 0, 1, 1},
  {&__pyx_n_s_DLSW, __pyx_k_DLSW, sizeof(__pyx_k_DLSW), 0, 0, 1, 1},
  {&__pyx_n_s_DOCSCABLEDOWNSTREAM, __pyx_k_DOCSCABLEDOWNSTREAM, sizeof(__pyx_k_DOCSCABLEDOWNSTREAM), 0, 0, 1, 1},
  {&__pyx_n_s_DOCSCABLEMACLAYER, __pyx_k_DOCSCABLEMACLAYER, sizeof(__pyx_k_DOCSCABLEMACLAYER), 0, 0, 1, 1},
  {&__pyx_n_s_DOCSCABLEUPSTREAM, __pyx_k_DOCSCABLEUPSTREAM, sizeof(__pyx_k_DOCSCABLEUPSTREAM), 0, 0, 1, 1},
  {&__pyx_n_s_DONE, __pyx_k_DONE, sizeof(__pyx_k_DONE), 0, 0, 1, 1},
  {&__pyx_n_s_DONT_SET_IFROUTE, __pyx_k_DONT_SET_IFROUTE, sizeof(__pyx_k_DONT_SET_IFROUTE), 0, 0, 1, 1},
  {&__pyx_n_s_DRV_OACTIVE, __pyx_k_DRV_OACTIVE, sizeof(__pyx_k_DRV_OACTIVE), 0, 0, 1, 1},
  {&__pyx_n_s_DRV_RUNNING, __pyx_k_DRV_RUNNING, sizeof(__pyx_k_DRV_RUNNING), 0, 0, 1, 1},
  {&__pyx_n_s_DS0, __pyx_k_DS0, sizeof(__pyx_k_DS0), 0, 0, 1, 1},
  {&__pyx_n_s_DS0BUNDLE, __pyx_k_DS0BUNDLE, sizeof(__pyx_k_DS0BUNDLE), 0, 0, 1, 1},
  {&__pyx_n_s_DS1FDL, __pyx_k_DS1FDL, sizeof(__pyx_k_DS1FDL), 0, 0, 1, 1},
  {&__pyx_n_s_DS3, __pyx_k_DS3, sizeof(__pyx_k_DS3), 0, 0, 1, 1},
  {&__pyx_n_s_DTM, __pyx_k_DTM, sizeof(__pyx_k_DTM), 0, 0, 1, 1},
  {&__pyx_n_s_DUPLICATED, __pyx_k_DUPLICATED, sizeof(__pyx_k_DUPLICATED), 0, 0, 1, 1},
  {&__pyx_n_s_DVBASILN, __pyx_k_DVBASILN, sizeof(__pyx_k_DVBASILN), 0, 0, 1, 1},
  {&__pyx_n_s_DVBASIOUT, __pyx_k_DVBASIOUT, sizeof(__pyx_k_DVBASIOUT), 0, 0, 1, 1},
  {&__pyx_n_s_DVBRCCDOWNSTREAM, __pyx_k_DVBRCCDOWNSTREAM, sizeof(__pyx_k_DVBRCCDOWNSTREAM), 0, 0, 1, 1},
  {&__pyx_n_s_DVBRCCMACLAYER, __pyx_k_DVBRCCMACLAYER, sizeof(__pyx_k_DVBRCCMACLAYER), 0, 0, 1, 1},
  {&__pyx_n_s_DVBRCCUPSTREAM, __pyx_k_DVBRCCUPSTREAM, sizeof(__pyx_k_DVBRCCUPSTREAM), 0, 0, 1, 1},
  {&__pyx_n_s_DYING, __pyx_k_DYING, sizeof(__pyx_k_DYING), 0, 0, 1, 1},
  {&__pyx_n_s_DYNAMIC, __pyx_k_DYNAMIC, sizeof(__pyx_k_DYNAMIC), 0, 0, 1, 1},
  {&__pyx_n_s_E164, __pyx_k_E164, sizeof(__pyx_k_E164), 0, 0, 1, 1},
  {&__pyx_n_s_ECMA, __pyx_k_ECMA, sizeof(__pyx_k_ECMA), 0, 0, 1, 1},
  {&__pyx_n_s_ENC, __pyx_k_ENC, sizeof(__pyx_k_ENC), 0, 0, 1, 1},
  {&__pyx_n_s_EON, __pyx_k_EON, sizeof(__pyx_k_EON), 0, 0, 1, 1},
  {&__pyx_n_s_EPLRS, __pyx_k_EPLRS, sizeof(__pyx_k_EPLRS), 0, 0, 1, 1},
  {&__pyx_n_s_ESCON, __pyx_k_ESCON, sizeof(__pyx_k_ESCON), 0, 0, 1, 1},
  {&__pyx_n_s_ETHER, __pyx_k_ETHER, sizeof(__pyx_k_ETHER), 0, 0, 1, 1},
  {&__pyx_n_s_ETHERCHANNEL, __pyx_k_ETHERCHANNEL, sizeof(__pyx_k_ETHERCHANNEL), 0, 0, 1, 1},
  {&__pyx_n_s_FAILOVER, __pyx_k_FAILOVER, sizeof(__pyx_k_FAILOVER), 0, 0, 1, 1},
  {&__pyx_n_s_FAST, __pyx_k_FAST, sizeof(__pyx_k_FAST), 0, 0, 1, 1},
  {&__pyx_n_s_FASTETHER, __pyx_k_FASTETHER, sizeof(__pyx_k_FASTETHER), 0, 0, 1, 1},
  {&__pyx_n_s_FASTETHERFX, __pyx_k_FASTETHERFX, sizeof(__pyx_k_FASTETHERFX), 0, 0, 1, 1},
  {&__pyx_n_s_FDDI, __pyx_k_FDDI, sizeof(__pyx_k_FDDI), 0, 0, 1, 1},
  {&__pyx_n_s_FDX, __pyx_k_FDX, sizeof(__pyx_k_FDX), 0, 0, 1, 1},
  {&__pyx_n_s_FIBRECHANNEL, __pyx_k_FIBRECHANNEL, sizeof(__pyx_k_FIBRECHANNEL), 0, 0, 1, 1},
  {&__pyx_n_s_FLAG0, __pyx_k_FLAG0, sizeof(__pyx_k_FLAG0), 0, 0, 1, 1},
  {&__pyx_n_s_FLAG1, __pyx_k_FLAG1, sizeof(__pyx_k_FLAG1), 0, 0, 1, 1},
  {&__pyx_n_s_FLAG2, __pyx_k_FLAG2, sizeof(__pyx_k_FLAG2), 0, 0, 1, 1},
  {&__pyx_n_s_FLOW, __pyx_k_FLOW, sizeof(__pyx_k_FLOW), 0, 0, 1, 1},
  {&__pyx_n_s_FRAMERELAYINTERCONNECT, __pyx_k_FRAMERELAYINTERCONNECT, sizeof(__pyx_k_FRAMERELAYINTERCONNECT), 0, 0, 1, 1},
  {&__pyx_n_s_FRAMERELAYMPI, __pyx_k_FRAMERELAYMPI, sizeof(__pyx_k_FRAMERELAYMPI), 0, 0, 1, 1},
  {&__pyx_n_s_FRDLCIENDPT, __pyx_k_FRDLCIENDPT, sizeof(__pyx_k_FRDLCIENDPT), 0, 0, 1, 1},
  {&__pyx_n_s_FRELAY, __pyx_k_FRELAY, sizeof(__pyx_k_FRELAY), 0, 0, 1, 1},
  {&__pyx_n_s_FRELAYDCE, __pyx_k_FRELAYDCE, sizeof(__pyx_k_FRELAYDCE), 0, 0, 1, 1},
  {&__pyx_n_s_FRF16MFRBUNDLE, __pyx_k_FRF16MFRBUNDLE, sizeof(__pyx_k_FRF16MFRBUNDLE), 0, 0, 1, 1},
  {&__pyx_n_s_FRFORWARD, __pyx_k_FRFORWARD, sizeof(__pyx_k_FRFORWARD), 0, 0, 1, 1},
  {&__pyx_n_s_G703AT2MB, __pyx_k_G703AT2MB, sizeof(__pyx_k_G703AT2MB), 0, 0, 1, 1},
  {&__pyx_n_s_G703AT64K, __pyx_k_G703AT64K, sizeof(__pyx_k_G703AT64K), 0, 0, 1, 1},
  {&__pyx_n_s_GATEWAY, __pyx_k_GATEWAY, sizeof(__pyx_k_GATEWAY), 0, 0, 1, 1},
  {&__pyx_n_s_GET, __pyx_k_GET, sizeof(__pyx_k_GET), 0, 0, 1, 1},
  {&__pyx_n_s_GIF, __pyx_k_GIF, sizeof(__pyx_k_GIF), 0, 0, 1, 1},
  {&__pyx_n_s_GIGABITETHERNET, __pyx_k_GIGABITETHERNET, sizeof(__pyx_k_GIGABITETHERNET), 0, 0, 1, 1},
  {&__pyx_n_s_GR303IDT, __pyx_k_GR303IDT, sizeof(__pyx_k_GR303IDT), 0, 0, 1, 1},
  {&__pyx_n_s_GR303RDT, __pyx_k_GR303RDT, sizeof(__pyx_k_GR303RDT), 0, 0, 1, 1},
  {&__pyx_n_s_H323GATEKEEPER, __pyx_k_H323GATEKEEPER, sizeof(__pyx_k_H323GATEKEEPER), 0, 0, 1, 1},
  {&__pyx_n_s_H323PROXY, __pyx_k_H323PROXY, sizeof(__pyx_k_H323PROXY), 0, 0, 1, 1},
  {&__pyx_n_s_HDH1822, __pyx_k_HDH1822, sizeof(__pyx_k_HDH1822), 0, 0, 1, 1},
  {&__pyx_n_s_HDLC, __pyx_k_HDLC, sizeof(__pyx_k_HDLC), 0, 0, 1, 1},
  {&__pyx_n_s_HDSL2, __pyx_k_HDSL2, sizeof(__pyx_k_HDSL2), 0, 0, 1, 1},
  {&__pyx_n_s_HDX, __pyx_k_HDX, sizeof(__pyx_k_HDX), 0, 0, 1, 1},
  {&__pyx_n_s_HIPERLAN2, __pyx_k_HIPERLAN2, sizeof(__pyx_k_HIPERLAN2), 0, 0, 1, 1},
  {&__pyx_n_s_HIPPI, __pyx_k_HIPPI, sizeof(__pyx_k_HIPPI), 0, 0, 1, 1},
  {&__pyx_n_s_HIPPIINTERFACE, __pyx_k_HIPPIINTERFACE, sizeof(__pyx_k_HIPPIINTERFACE), 0, 0, 1, 1},
  {&__pyx_n_s_HOST, __pyx_k_HOST, sizeof(__pyx_k_HOST), 0, 0, 1, 1},
  {&__pyx_n_s_HOSTPAD, __pyx_k_HOSTPAD, sizeof(__pyx_k_HOSTPAD), 0, 0, 1, 1},
  {&__pyx_n_s_HSSI, __pyx_k_HSSI, sizeof(__pyx_k_HSSI), 0, 0, 1, 1},
  {&__pyx_n_s_HWSTATS, __pyx_k_HWSTATS, sizeof(__pyx_k_HWSTATS), 0, 0, 1, 1},
  {&__pyx_n_s_HY, __pyx_k_HY, sizeof(__pyx_k_HY), 0, 0, 1, 1},
  {&__pyx_n_s_HYLINK, __pyx_k_HYLINK, sizeof(__pyx_k_HYLINK), 0, 0, 1, 1},
  {&__pyx_n_s_I1822, __pyx_k_I1822, sizeof(__pyx_k_I1822), 0, 0, 1, 1},
  {&__pyx_n_s_IBM370PARCHAN, __pyx_k_IBM370PARCHAN, sizeof(__pyx_k_IBM370PARCHAN), 0, 0, 1, 1},
  {&__pyx_n_s_IDSL, __pyx_k_IDSL, sizeof(__pyx_k_IDSL), 0, 0, 1, 1},
  {&__pyx_n_s_IEEE1394, __pyx_k_IEEE1394, sizeof(__pyx_k_IEEE1394), 0, 0, 1, 1},
  {&__pyx_n_s_IEEE80211, __pyx_k_IEEE80211, sizeof(__pyx_k_IEEE80211), 0, 0, 1, 1},
  {&__pyx_n_s_IEEE80212, __pyx_k_IEEE80212, sizeof(__pyx_k_IEEE80212), 0, 0, 1, 1},
  {&__pyx_n_s_IEEE8023ADLAG, __pyx_k_IEEE8023ADLAG, sizeof(__pyx_k_IEEE8023ADLAG), 0, 0, 1, 1},
  {&__pyx_n_s_IFANNOUNCE, __pyx_k_IFANNOUNCE, sizeof(__pyx_k_IFANNOUNCE), 0, 0, 1, 1},
  {&__pyx_n_s_IFDISABLED, __pyx_k_IFDISABLED, sizeof(__pyx_k_IFDISABLED), 0, 0, 1, 1},
  {&__pyx_n_s_IFGSN, __pyx_k_IFGSN, sizeof(__pyx_k_IFGSN), 0, 0, 1, 1},
  {&__pyx_n_s_IFINFO, __pyx_k_IFINFO, sizeof(__pyx_k_IFINFO), 0, 0, 1, 1},
  {&__pyx_n_s_IMPLINK, __pyx_k_IMPLINK, sizeof(__pyx_k_IMPLINK), 0, 0, 1, 1},
  {&__pyx_n_s_IMT, __pyx_k_IMT, sizeof(__pyx_k_IMT), 0, 0, 1, 1},
  {&__pyx_n_s_INET, __pyx_k_INET, sizeof(__pyx_k_INET), 0, 0, 1, 1},
  {&__pyx_n_s_INET6, __pyx_k_INET6, sizeof(__pyx_k_INET6), 0, 0, 1, 1},
  {&__pyx_n_s_INET6_SDP, __pyx_k_INET6_SDP, sizeof(__pyx_k_INET6_SDP), 0, 0, 1, 1},
  {&__pyx_n_s_INET_SDP, __pyx_k_INET_SDP, sizeof(__pyx_k_INET_SDP), 0, 0, 1, 1},
  {&__pyx_n_s_INFINIBAND, __pyx_k_INFINIBAND, sizeof(__pyx_k_INFINIBAND), 0, 0, 1, 1},
  {&__pyx_n_s_INIT, __pyx_k_INIT, sizeof(__pyx_k_INIT), 0, 0, 1, 1},
  {&__pyx_n_s_INTERLEAVE, __pyx_k_INTERLEAVE, sizeof(__pyx_k_INTERLEAVE), 0, 0, 1, 1},
  {&__pyx_n_s_INVALID, __pyx_k_INVALID, sizeof(__pyx_k_INVALID), 0, 0, 1, 1},
  {&__pyx_n_s_IP, __pyx_k_IP, sizeof(__pyx_k_IP), 0, 0, 1, 1},
  {&__pyx_n_s_IPFORWARD, __pyx_k_IPFORWARD, sizeof(__pyx_k_IPFORWARD), 0, 0, 1, 1},
  {&__pyx_n_s_IPOVERATM, __pyx_k_IPOVERATM, sizeof(__pyx_k_IPOVERATM), 0, 0, 1, 1},
  {&__pyx_n_s_IPOVERCDLC, __pyx_k_IPOVERCDLC, sizeof(__pyx_k_IPOVERCDLC), 0, 0, 1, 1},
  {&__pyx_n_s_IPOVERCLAW, __pyx_k_IPOVERCLAW, sizeof(__pyx_k_IPOVERCLAW), 0, 0, 1, 1},
  {&__pyx_n_s_IPSWITCH, __pyx_k_IPSWITCH, sizeof(__pyx_k_IPSWITCH), 0, 0, 1, 1},
  {&__pyx_n_s_IPX, __pyx_k_IPX, sizeof(__pyx_k_IPX), 0, 0, 1, 1},
  {&__pyx_n_s_IPv4Interface, __pyx_k_IPv4Interface, sizeof(__pyx_k_IPv4Interface), 0, 0, 1, 1},
  {&__pyx_n_s_IPv6Interface, __pyx_k_IPv6Interface, sizeof(__pyx_k_IPv6Interface), 0, 0, 1, 1},
  {&__pyx_n_s_ISDN, __pyx_k_ISDN, sizeof(__pyx_k_ISDN), 0, 0, 1, 1},
  {&__pyx_n_s_ISDNBASIC, __pyx_k_ISDNBASIC, sizeof(__pyx_k_ISDNBASIC), 0, 0, 1, 1},
  {&__pyx_n_s_ISDNPRIMARY, __pyx_k_ISDNPRIMARY, sizeof(__pyx_k_ISDNPRIMARY), 0, 0, 1, 1},
  {&__pyx_n_s_ISDNS, __pyx_k_ISDNS, sizeof(__pyx_k_ISDNS), 0, 0, 1, 1},
  {&__pyx_n_s_ISDNU, __pyx_k_ISDNU, sizeof(__pyx_k_ISDNU), 0, 0, 1, 1},
  {&__pyx_n_s_ISO, __pyx_k_ISO, sizeof(__pyx_k_ISO), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88022LLC, __pyx_k_ISO88022LLC, sizeof(__pyx_k_ISO88022LLC), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88023, __pyx_k_ISO88023, sizeof(__pyx_k_ISO88023), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88024, __pyx_k_ISO88024, sizeof(__pyx_k_ISO88024), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88025, __pyx_k_ISO88025, sizeof(__pyx_k_ISO88025), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88025CRFPINT, __pyx_k_ISO88025CRFPINT, sizeof(__pyx_k_ISO88025CRFPINT), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88025DTR, __pyx_k_ISO88025DTR, sizeof(__pyx_k_ISO88025DTR), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88025FIBER, __pyx_k_ISO88025FIBER, sizeof(__pyx_k_ISO88025FIBER), 0, 0, 1, 1},
  {&__pyx_n_s_ISO88026, __pyx_k_ISO88026, sizeof(__pyx_k_ISO88026), 0, 0, 1, 1},
  {&__pyx_n_s_ISUP, __pyx_k_ISUP, sizeof(__pyx_k_ISUP), 0, 0, 1, 1},
  {&__pyx_n_s_In6AddrFlags, __pyx_k_In6AddrFlags, sizeof(__pyx_k_In6AddrFlags), 0, 0, 1, 1},
  {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress, __pyx_k_InterfaceAddress, sizeof(__pyx_k_InterfaceAddress), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress___eq, __pyx_k_InterfaceAddress___eq, sizeof(__pyx_k_InterfaceAddress___eq), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress___getstate, __pyx_k_InterfaceAddress___getstate, sizeof(__pyx_k_InterfaceAddress___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress___hash, __pyx_k_InterfaceAddress___hash, sizeof(__pyx_k_InterfaceAddress___hash), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress___init, __pyx_k_InterfaceAddress___init, sizeof(__pyx_k_InterfaceAddress___init), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress___ne, __pyx_k_InterfaceAddress___ne, sizeof(__pyx_k_InterfaceAddress___ne), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAddress___str, __pyx_k_InterfaceAddress___str, sizeof(__pyx_k_InterfaceAddress___str), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceAnnounceType, __pyx_k_InterfaceAnnounceType, sizeof(__pyx_k_InterfaceAnnounceType), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceCapability, __pyx_k_InterfaceCapability, sizeof(__pyx_k_InterfaceCapability), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceFlags, __pyx_k_InterfaceFlags, sizeof(__pyx_k_InterfaceFlags), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceLinkState, __pyx_k_InterfaceLinkState, sizeof(__pyx_k_InterfaceLinkState), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceMediaOption, __pyx_k_InterfaceMediaOption, sizeof(__pyx_k_InterfaceMediaOption), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceType, __pyx_k_InterfaceType, sizeof(__pyx_k_InterfaceType), 0, 0, 1, 1},
  {&__pyx_n_s_JUMBO_MTU, __pyx_k_JUMBO_MTU, sizeof(__pyx_k_JUMBO_MTU), 0, 0, 1, 1},
  {&__pyx_n_s_L2VLAN, __pyx_k_L2VLAN, sizeof(__pyx_k_L2VLAN), 0, 0, 1, 1},
  {&__pyx_n_s_L3IPVLAN, __pyx_k_L3IPVLAN, sizeof(__pyx_k_L3IPVLAN), 0, 0, 1, 1},
  {&__pyx_n_s_L3IPXVLAN, __pyx_k_L3IPXVLAN, sizeof(__pyx_k_L3IPXVLAN), 0, 0, 1, 1},
  {&__pyx_n_s_LACP, __pyx_k_LACP, sizeof(__pyx_k_LACP), 0, 0, 1, 1},
  {&__pyx_n_s_LAPB, __pyx_k_LAPB, sizeof(__pyx_k_LAPB), 0, 0, 1, 1},
  {&__pyx_n_s_LAPD, __pyx_k_LAPD, sizeof(__pyx_k_LAPD), 0, 0, 1, 1},
  {&__pyx_n_s_LAPF, __pyx_k_LAPF, sizeof(__pyx_k_LAPF), 0, 0, 1, 1},
  {&__pyx_n_s_LAT, __pyx_k_LAT, sizeof(__pyx_k_LAT), 0, 0, 1, 1},
  {&__pyx_n_s_LINK, __pyx_k_LINK, sizeof(__pyx_k_LINK), 0, 0, 1, 1},
  {&__pyx_n_s_LINK0, __pyx_k_LINK0, sizeof(__pyx_k_LINK0), 0, 0, 1, 1},
  {&__pyx_n_s_LINK1, __pyx_k_LINK1, sizeof(__pyx_k_LINK1), 0, 0, 1, 1},
  {&__pyx_n_s_LINK2, __pyx_k_LINK2, sizeof(__pyx_k_LINK2), 0, 0, 1, 1},
  {&__pyx_n_s_LINKSTATE, __pyx_k_LINKSTATE, sizeof(__pyx_k_LINKSTATE), 0, 0, 1, 1},
  {&__pyx_n_s_LINK_STATE_DOWN, __pyx_k_LINK_STATE_DOWN, sizeof(__pyx_k_LINK_STATE_DOWN), 0, 0, 1, 1},
  {&__pyx_n_s_LINK_STATE_UNKNOWN, __pyx_k_LINK_STATE_UNKNOWN, sizeof(__pyx_k_LINK_STATE_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s_LINK_STATE_UP, __pyx_k_LINK_STATE_UP, sizeof(__pyx_k_LINK_STATE_UP), 0, 0, 1, 1},
  {&__pyx_n_s_LLDATA, __pyx_k_LLDATA, sizeof(__pyx_k_LLDATA), 0, 0, 1, 1},
  {&__pyx_n_s_LLINFO, __pyx_k_LLINFO, sizeof(__pyx_k_LLINFO), 0, 0, 1, 1},
  {&__pyx_n_s_LOADBALANCE, __pyx_k_LOADBALANCE, sizeof(__pyx_k_LOADBALANCE), 0, 0, 1, 1},
  {&__pyx_n_s_LOCAL, __pyx_k_LOCAL, sizeof(__pyx_k_LOCAL), 0, 0, 1, 1},
  {&__pyx_n_s_LOCALTALK, __pyx_k_LOCALTALK, sizeof(__pyx_k_LOCALTALK), 0, 0, 1, 1},
  {&__pyx_n_s_LOCK, __pyx_k_LOCK, sizeof(__pyx_k_LOCK), 0, 0, 1, 1},
  {&__pyx_n_s_LOOP, __pyx_k_LOOP, sizeof(__pyx_k_LOOP), 0, 0, 1, 1},
  {&__pyx_n_s_LOOPBACK, __pyx_k_LOOPBACK, sizeof(__pyx_k_LOOPBACK), 0, 0, 1, 1},
  {&__pyx_n_s_LOSING, __pyx_k_LOSING, sizeof(__pyx_k_LOSING), 0, 0, 1, 1},
  {&__pyx_n_s_LRO, __pyx_k_LRO, sizeof(__pyx_k_LRO), 0, 0, 1, 1},
  {&__pyx_n_s_LaggInterface___get, __pyx_k_LaggInterface___get, sizeof(__pyx_k_LaggInterface___get), 0, 0, 1, 1},
  {&__pyx_n_s_LaggPortFlags, __pyx_k_LaggPortFlags, sizeof(__pyx_k_LaggPortFlags), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress, __pyx_k_LinkAddress, sizeof(__pyx_k_LinkAddress), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress___eq, __pyx_k_LinkAddress___eq, sizeof(__pyx_k_LinkAddress___eq), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress___getstate, __pyx_k_LinkAddress___getstate, sizeof(__pyx_k_LinkAddress___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress___hash, __pyx_k_LinkAddress___hash, sizeof(__pyx_k_LinkAddress___hash), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress___init, __pyx_k_LinkAddress___init, sizeof(__pyx_k_LinkAddress___init), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress___ne, __pyx_k_LinkAddress___ne, sizeof(__pyx_k_LinkAddress___ne), 0, 0, 1, 1},
  {&__pyx_n_s_LinkAddress___str, __pyx_k_LinkAddress___str, sizeof(__pyx_k_LinkAddress___str), 0, 0, 1, 1},
  {&__pyx_n_s_MANUAL, __pyx_k_MANUAL, sizeof(__pyx_k_MANUAL), 0, 0, 1, 1},
  {&__pyx_n_s_MASTER, __pyx_k_MASTER, sizeof(__pyx_k_MASTER), 0, 0, 1, 1},
  {&__pyx_n_s_MEDIAMAILOVERIP, __pyx_k_MEDIAMAILOVERIP, sizeof(__pyx_k_MEDIAMAILOVERIP), 0, 0, 1, 1},
  {&__pyx_n_s_MFSIGLINK, __pyx_k_MFSIGLINK, sizeof(__pyx_k_MFSIGLINK), 0, 0, 1, 1},
  {&__pyx_n_s_MIOX25, __pyx_k_MIOX25, sizeof(__pyx_k_MIOX25), 0, 0, 1, 1},
  {&__pyx_n_s_MISS, __pyx_k_MISS, sizeof(__pyx_k_MISS), 0, 0, 1, 1},
  {&__pyx_n_s_MODEM, __pyx_k_MODEM, sizeof(__pyx_k_MODEM), 0, 0, 1, 1},
  {&__pyx_n_s_MODIFIED, __pyx_k_MODIFIED, sizeof(__pyx_k_MODIFIED), 0, 0, 1, 1},
  {&__pyx_n_s_MONITOR, __pyx_k_MONITOR, sizeof(__pyx_k_MONITOR), 0, 0, 1, 1},
  {&__pyx_n_s_MPC, __pyx_k_MPC, sizeof(__pyx_k_MPC), 0, 0, 1, 1},
  {&__pyx_n_s_MPLS, __pyx_k_MPLS, sizeof(__pyx_k_MPLS), 0, 0, 1, 1},
  {&__pyx_n_s_MPLSTUNNEL, __pyx_k_MPLSTUNNEL, sizeof(__pyx_k_MPLSTUNNEL), 0, 0, 1, 1},
  {&__pyx_n_s_MSDSL, __pyx_k_MSDSL, sizeof(__pyx_k_MSDSL), 0, 0, 1, 1},
  {&__pyx_n_s_MULTICAST, __pyx_k_MULTICAST, sizeof(__pyx_k_MULTICAST), 0, 0, 1, 1},
  {&__pyx_n_s_MVL, __pyx_k_MVL, sizeof(__pyx_k_MVL), 0, 0, 1, 1},
  {&__pyx_n_s_MYRINET, __pyx_k_MYRINET, sizeof(__pyx_k_MYRINET), 0, 0, 1, 1},
  {&__pyx_n_s_NATM, __pyx_k_NATM, sizeof(__pyx_k_NATM), 0, 0, 1, 1},
  {&__pyx_n_s_NETBIOS, __pyx_k_NETBIOS, sizeof(__pyx_k_NETBIOS), 0, 0, 1, 1},
  {&__pyx_n_s_NETCONS, __pyx_k_NETCONS, sizeof(__pyx_k_NETCONS), 0, 0, 1, 1},
  {&__pyx_n_s_NETGRAPH, __pyx_k_NETGRAPH, sizeof(__pyx_k_NETGRAPH), 0, 0, 1, 1},
  {&__pyx_n_s_NETMAP, __pyx_k_NETMAP, sizeof(__pyx_k_NETMAP), 0, 0, 1, 1},
  {&__pyx_n_s_NEWADDR, __pyx_k_NEWADDR, sizeof(__pyx_k_NEWADDR), 0, 0, 1, 1},
  {&__pyx_n_s_NEWMADDR, __pyx_k_NEWMADDR, sizeof(__pyx_k_NEWMADDR), 0, 0, 1, 1},
  {&__pyx_n_s_NFAS, __pyx_k_NFAS, sizeof(__pyx_k_NFAS), 0, 0, 1, 1},
  {&__pyx_n_s_NOARP, __pyx_k_NOARP, sizeof(__pyx_k_NOARP), 0, 0, 1, 1},
  {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1},
  {&__pyx_n_s_NO_PREFER_IFACE, __pyx_k_NO_PREFER_IFACE, sizeof(__pyx_k_NO_PREFER_IFACE), 0, 0, 1, 1},
  {&__pyx_n_s_NO_RADR, __pyx_k_NO_RADR, sizeof(__pyx_k_NO_RADR), 0, 0, 1, 1},
  {&__pyx_n_s_NSIP, __pyx_k_NSIP, sizeof(__pyx_k_NSIP), 0, 0, 1, 1},
  {&__pyx_n_s_NeighborDiscoveryFlags, __pyx_k_NeighborDiscoveryFlags, sizeof(__pyx_k_NeighborDiscoveryFlags), 0, 0, 1, 1},
  {&__pyx_n_s_NetworkInterface___get, __pyx_k_NetworkInterface___get, sizeof(__pyx_k_NetworkInterface___get), 0, 0, 1, 1},
  {&__pyx_n_s_NetworkInterface___get___locals, __pyx_k_NetworkInterface___get___locals, sizeof(__pyx_k_NetworkInterface___get___locals), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_OPTICALCHANNEL, __pyx_k_OPTICALCHANNEL, sizeof(__pyx_k_OPTICALCHANNEL), 0, 0, 1, 1},
  {&__pyx_n_s_OPTICALTRANSPORT, __pyx_k_OPTICALTRANSPORT, sizeof(__pyx_k_OPTICALTRANSPORT), 0, 0, 1, 1},
  {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
  {&__pyx_n_s_OSI, __pyx_k_OSI, sizeof(__pyx_k_OSI), 0, 0, 1, 1},
  {&__pyx_n_s_OTHER, __pyx_k_OTHER, sizeof(__pyx_k_OTHER), 0, 0, 1, 1},
  {&__pyx_n_s_P10, __pyx_k_P10, sizeof(__pyx_k_P10), 0, 0, 1, 1},
  {&__pyx_n_s_P80, __pyx_k_P80, sizeof(__pyx_k_P80), 0, 0, 1, 1},
  {&__pyx_n_s_PARA, __pyx_k_PARA, sizeof(__pyx_k_PARA), 0, 0, 1, 1},
  {&__pyx_n_s_PERFORMNUD, __pyx_k_PERFORMNUD, sizeof(__pyx_k_PERFORMNUD), 0, 0, 1, 1},
  {&__pyx_n_s_PFLOG, __pyx_k_PFLOG, sizeof(__pyx_k_PFLOG), 0, 0, 1, 1},
  {&__pyx_n_s_PFSYNC, __pyx_k_PFSYNC, sizeof(__pyx_k_PFSYNC), 0, 0, 1, 1},
  {&__pyx_n_s_PINNED, __pyx_k_PINNED, sizeof(__pyx_k_PINNED), 0, 0, 1, 1},
  {&__pyx_n_s_PLC, __pyx_k_PLC, sizeof(__pyx_k_PLC), 0, 0, 1, 1},
  {&__pyx_n_s_POINTOPOINT, __pyx_k_POINTOPOINT, sizeof(__pyx_k_POINTOPOINT), 0, 0, 1, 1},
  {&__pyx_n_s_POLLING, __pyx_k_POLLING, sizeof(__pyx_k_POLLING), 0, 0, 1, 1},
  {&__pyx_n_s_POLLING_NOCOUNT, __pyx_k_POLLING_NOCOUNT, sizeof(__pyx_k_POLLING_NOCOUNT), 0, 0, 1, 1},
  {&__pyx_n_s_POS, __pyx_k_POS, sizeof(__pyx_k_POS), 0, 0, 1, 1},
  {&__pyx_n_s_PPP, __pyx_k_PPP, sizeof(__pyx_k_PPP), 0, 0, 1, 1},
  {&__pyx_n_s_PPPMULTILINKBUNDLE, __pyx_k_PPPMULTILINKBUNDLE, sizeof(__pyx_k_PPPMULTILINKBUNDLE), 0, 0, 1, 1},
  {&__pyx_n_s_PPROMISC, __pyx_k_PPROMISC, sizeof(__pyx_k_PPROMISC), 0, 0, 1, 1},
  {&__pyx_n_s_PREFER_SOURCE, __pyx_k_PREFER_SOURCE, sizeof(__pyx_k_PREFER_SOURCE), 0, 0, 1, 1},
  {&__pyx_n_s_PROMISC, __pyx_k_PROMISC, sizeof(__pyx_k_PROMISC), 0, 0, 1, 1},
  {&__pyx_n_s_PROPBWAP2MP, __pyx_k_PROPBWAP2MP, sizeof(__pyx_k_PROPBWAP2MP), 0, 0, 1, 1},
  {&__pyx_n_s_PROPCNLS, __pyx_k_PROPCNLS, sizeof(__pyx_k_PROPCNLS), 0, 0, 1, 1},
  {&__pyx_n_s_PROPDOCSWIRELESSDOWNSTREAM, __pyx_k_PROPDOCSWIRELESSDOWNSTREAM, sizeof(__pyx_k_PROPDOCSWIRELESSDOWNSTREAM), 0, 0, 1, 1},
  {&__pyx_n_s_PROPDOCSWIRELESSMACLAYER, __pyx_k_PROPDOCSWIRELESSMACLAYER, sizeof(__pyx_k_PROPDOCSWIRELESSMACLAYER), 0, 0, 1, 1},
  {&__pyx_n_s_PROPDOCSWIRELESSUPSTREAM, __pyx_k_PROPDOCSWIRELESSUPSTREAM, sizeof(__pyx_k_PROPDOCSWIRELESSUPSTREAM), 0, 0, 1, 1},
  {&__pyx_n_s_PROPMUX, __pyx_k_PROPMUX, sizeof(__pyx_k_PROPMUX), 0, 0, 1, 1},
  {&__pyx_n_s_PROPVIRTUAL, __pyx_k_PROPVIRTUAL, sizeof(__pyx_k_PROPVIRTUAL), 0, 0, 1, 1},
  {&__pyx_n_s_PROPWIRELESSP2P, __pyx_k_PROPWIRELESSP2P, sizeof(__pyx_k_PROPWIRELESSP2P), 0, 0, 1, 1},
  {&__pyx_n_s_PROTO1, __pyx_k_PROTO1, sizeof(__pyx_k_PROTO1), 0, 0, 1, 1},
  {&__pyx_n_s_PROTO2, __pyx_k_PROTO2, sizeof(__pyx_k_PROTO2), 0, 0, 1, 1},
  {&__pyx_n_s_PROTO3, __pyx_k_PROTO3, sizeof(__pyx_k_PROTO3), 0, 0, 1, 1},
  {&__pyx_n_s_PTPSERIAL, __pyx_k_PTPSERIAL, sizeof(__pyx_k_PTPSERIAL), 0, 0, 1, 1},
  {&__pyx_n_s_PUP, __pyx_k_PUP, sizeof(__pyx_k_PUP), 0, 0, 1, 1},
  {&__pyx_n_s_PVC, __pyx_k_PVC, sizeof(__pyx_k_PVC), 0, 0, 1, 1},
  {&__pyx_n_s_QLLC, __pyx_k_QLLC, sizeof(__pyx_k_QLLC), 0, 0, 1, 1},
  {&__pyx_n_s_RADIOMAC, __pyx_k_RADIOMAC, sizeof(__pyx_k_RADIOMAC), 0, 0, 1, 1},
  {&__pyx_n_s_RADSL, __pyx_k_RADSL, sizeof(__pyx_k_RADSL), 0, 0, 1, 1},
  {&__pyx_n_s_REACHDSL, __pyx_k_REACHDSL, sizeof(__pyx_k_REACHDSL), 0, 0, 1, 1},
  {&__pyx_n_s_REDIRECT, __pyx_k_REDIRECT, sizeof(__pyx_k_REDIRECT), 0, 0, 1, 1},
  {&__pyx_n_s_REJECT, __pyx_k_REJECT, sizeof(__pyx_k_REJECT), 0, 0, 1, 1},
  {&__pyx_n_s_RENAMING, __pyx_k_RENAMING, sizeof(__pyx_k_RENAMING), 0, 0, 1, 1},
  {&__pyx_n_s_RESOLVE, __pyx_k_RESOLVE, sizeof(__pyx_k_RESOLVE), 0, 0, 1, 1},
  {&__pyx_n_s_RFC1483, __pyx_k_RFC1483, sizeof(__pyx_k_RFC1483), 0, 0, 1, 1},
  {&__pyx_n_s_ROUNDROBIN, __pyx_k_ROUNDROBIN, sizeof(__pyx_k_ROUNDROBIN), 0, 0, 1, 1},
  {&__pyx_n_s_ROUTE, __pyx_k_ROUTE, sizeof(__pyx_k_ROUTE), 0, 0, 1, 1},
  {&__pyx_n_s_RS232, __pyx_k_RS232, sizeof(__pyx_k_RS232), 0, 0, 1, 1},
  {&__pyx_n_s_RSRB, __pyx_k_RSRB, sizeof(__pyx_k_RSRB), 0, 0, 1, 1},
  {&__pyx_n_s_RXCSUM, __pyx_k_RXCSUM, sizeof(__pyx_k_RXCSUM), 0, 0, 1, 1},
  {&__pyx_n_s_RXCSUM_IPV6, __pyx_k_RXCSUM_IPV6, sizeof(__pyx_k_RXCSUM_IPV6), 0, 0, 1, 1},
  {&__pyx_n_s_Route, __pyx_k_Route, sizeof(__pyx_k_Route), 0, 0, 1, 1},
  {&__pyx_n_s_RouteFlags, __pyx_k_RouteFlags, sizeof(__pyx_k_RouteFlags), 0, 0, 1, 1},
  {&__pyx_n_s_Route___eq, __pyx_k_Route___eq, sizeof(__pyx_k_Route___eq), 0, 0, 1, 1},
  {&__pyx_n_s_Route___getstate, __pyx_k_Route___getstate, sizeof(__pyx_k_Route___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Route___hash, __pyx_k_Route___hash, sizeof(__pyx_k_Route___hash), 0, 0, 1, 1},
  {&__pyx_n_s_Route___init, __pyx_k_Route___init, sizeof(__pyx_k_Route___init), 0, 0, 1, 1},
  {&__pyx_n_s_Route___ne, __pyx_k_Route___ne, sizeof(__pyx_k_Route___ne), 0, 0, 1, 1},
  {&__pyx_n_s_Route_af, __pyx_k_Route_af, sizeof(__pyx_k_Route_af), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingMessageType, __pyx_k_RoutingMessageType, sizeof(__pyx_k_RoutingMessageType), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingSocket, __pyx_k_RoutingSocket, sizeof(__pyx_k_RoutingSocket), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingSocket___init, __pyx_k_RoutingSocket___init, sizeof(__pyx_k_RoutingSocket___init), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingSocket_close, __pyx_k_RoutingSocket_close, sizeof(__pyx_k_RoutingSocket_close), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingSocket_open, __pyx_k_RoutingSocket_open, sizeof(__pyx_k_RoutingSocket_open), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingSocket_read_message, __pyx_k_RoutingSocket_read_message, sizeof(__pyx_k_RoutingSocket_read_message), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingSocket_write_message, __pyx_k_RoutingSocket_write_message, sizeof(__pyx_k_RoutingSocket_write_message), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable, __pyx_k_RoutingTable, sizeof(__pyx_k_RoutingTable), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable___init, __pyx_k_RoutingTable___init, sizeof(__pyx_k_RoutingTable___init), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable___send_message, __pyx_k_RoutingTable___send_message, sizeof(__pyx_k_RoutingTable___send_message), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable___send_route, __pyx_k_RoutingTable___send_route, sizeof(__pyx_k_RoutingTable___send_route), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable__send_message, __pyx_k_RoutingTable__send_message, sizeof(__pyx_k_RoutingTable__send_message), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable__send_route, __pyx_k_RoutingTable__send_route, sizeof(__pyx_k_RoutingTable__send_route), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_add, __pyx_k_RoutingTable_add, sizeof(__pyx_k_RoutingTable_add), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_change, __pyx_k_RoutingTable_change, sizeof(__pyx_k_RoutingTable_change), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_default_route, __pyx_k_RoutingTable_default_route, sizeof(__pyx_k_RoutingTable_default_route), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_default_route_ipv4, __pyx_k_RoutingTable_default_route_ipv4, sizeof(__pyx_k_RoutingTable_default_route_ipv4), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_default_route_ipv4_2, __pyx_k_RoutingTable_default_route_ipv4_2, sizeof(__pyx_k_RoutingTable_default_route_ipv4_2), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_default_route_ipv6, __pyx_k_RoutingTable_default_route_ipv6, sizeof(__pyx_k_RoutingTable_default_route_ipv6), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_default_route_ipv6_2, __pyx_k_RoutingTable_default_route_ipv6_2, sizeof(__pyx_k_RoutingTable_default_route_ipv6_2), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_default_route_local, __pyx_k_RoutingTable_default_route_local, sizeof(__pyx_k_RoutingTable_default_route_local), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_delete, __pyx_k_RoutingTable_delete, sizeof(__pyx_k_RoutingTable_delete), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_routes, __pyx_k_RoutingTable_routes, sizeof(__pyx_k_RoutingTable_routes), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_static_routes, __pyx_k_RoutingTable_static_routes, sizeof(__pyx_k_RoutingTable_static_routes), 0, 0, 1, 1},
  {&__pyx_n_s_RoutingTable_static_routes_local, __pyx_k_RoutingTable_static_routes_local, sizeof(__pyx_k_RoutingTable_static_routes_local), 0, 0, 1, 1},
  {&__pyx_n_s_SCLUSTER, __pyx_k_SCLUSTER, sizeof(__pyx_k_SCLUSTER), 0, 0, 1, 1},
  {&__pyx_n_s_SDLC, __pyx_k_SDLC, sizeof(__pyx_k_SDLC), 0, 0, 1, 1},
  {&__pyx_n_s_SDSL, __pyx_k_SDSL, sizeof(__pyx_k_SDSL), 0, 0, 1, 1},
  {&__pyx_n_s_SHDSL, __pyx_k_SHDSL, sizeof(__pyx_k_SHDSL), 0, 0, 1, 1},
  {&__pyx_n_s_SIMPLEX, __pyx_k_SIMPLEX, sizeof(__pyx_k_SIMPLEX), 0, 0, 1, 1},
  {&__pyx_n_s_SIP, __pyx_k_SIP, sizeof(__pyx_k_SIP), 0, 0, 1, 1},
  {&__pyx_n_s_SLAVE, __pyx_k_SLAVE, sizeof(__pyx_k_SLAVE), 0, 0, 1, 1},
  {&__pyx_n_s_SLIP, __pyx_k_SLIP, sizeof(__pyx_k_SLIP), 0, 0, 1, 1},
  {&__pyx_n_s_SLOW, __pyx_k_SLOW, sizeof(__pyx_k_SLOW), 0, 0, 1, 1},
  {&__pyx_n_s_SMDSDXI, __pyx_k_SMDSDXI, sizeof(__pyx_k_SMDSDXI), 0, 0, 1, 1},
  {&__pyx_n_s_SMDSICIP, __pyx_k_SMDSICIP, sizeof(__pyx_k_SMDSICIP), 0, 0, 1, 1},
  {&__pyx_n_s_SNA, __pyx_k_SNA, sizeof(__pyx_k_SNA), 0, 0, 1, 1},
  {&__pyx_n_s_SOCK_DGRAM, __pyx_k_SOCK_DGRAM, sizeof(__pyx_k_SOCK_DGRAM), 0, 0, 1, 1},
  {&__pyx_n_s_SOCK_RAW, __pyx_k_SOCK_RAW, sizeof(__pyx_k_SOCK_RAW), 0, 0, 1, 1},
  {&__pyx_n_s_SOCK_STREAM, __pyx_k_SOCK_STREAM, sizeof(__pyx_k_SOCK_STREAM), 0, 0, 1, 1},
  {&__pyx_n_s_SONET, __pyx_k_SONET, sizeof(__pyx_k_SONET), 0, 0, 1, 1},
  {&__pyx_n_s_SONETOVERHEADCHANNEL, __pyx_k_SONETOVERHEADCHANNEL, sizeof(__pyx_k_SONETOVERHEADCHANNEL), 0, 0, 1, 1},
  {&__pyx_n_s_SONETPATH, __pyx_k_SONETPATH, sizeof(__pyx_k_SONETPATH), 0, 0, 1, 1},
  {&__pyx_n_s_SONETVT, __pyx_k_SONETVT, sizeof(__pyx_k_SONETVT), 0, 0, 1, 1},
  {&__pyx_n_s_SRP, __pyx_k_SRP, sizeof(__pyx_k_SRP), 0, 0, 1, 1},
  {&__pyx_n_s_SS7SIGLINK, __pyx_k_SS7SIGLINK, sizeof(__pyx_k_SS7SIGLINK), 0, 0, 1, 1},
  {&__pyx_n_s_STACK, __pyx_k_STACK, sizeof(__pyx_k_STACK), 0, 0, 1, 1},
  {&__pyx_n_s_STACKTOSTACK, __pyx_k_STACKTOSTACK, sizeof(__pyx_k_STACKTOSTACK), 0, 0, 1, 1},
  {&__pyx_n_s_STARLAN, __pyx_k_STARLAN, sizeof(__pyx_k_STARLAN), 0, 0, 1, 1},
  {&__pyx_n_s_STATIC, __pyx_k_STATIC, sizeof(__pyx_k_STATIC), 0, 0, 1, 1},
  {&__pyx_n_s_STATICARP, __pyx_k_STATICARP, sizeof(__pyx_k_STATICARP), 0, 0, 1, 1},
  {&__pyx_n_s_STF, __pyx_k_STF, sizeof(__pyx_k_STF), 0, 0, 1, 1},
  {&__pyx_n_s_STICKY, __pyx_k_STICKY, sizeof(__pyx_k_STICKY), 0, 0, 1, 1},
  {&__pyx_n_s_T1, __pyx_k_T1, sizeof(__pyx_k_T1), 0, 0, 1, 1},
  {&__pyx_n_s_TDLC, __pyx_k_TDLC, sizeof(__pyx_k_TDLC), 0, 0, 1, 1},
  {&__pyx_n_s_TEMPORARY, __pyx_k_TEMPORARY, sizeof(__pyx_k_TEMPORARY), 0, 0, 1, 1},
  {&__pyx_n_s_TENTATIVE, __pyx_k_TENTATIVE, sizeof(__pyx_k_TENTATIVE), 0, 0, 1, 1},
  {&__pyx_n_s_TERMPAD, __pyx_k_TERMPAD, sizeof(__pyx_k_TERMPAD), 0, 0, 1, 1},
  {&__pyx_n_s_TOE4, __pyx_k_TOE4, sizeof(__pyx_k_TOE4), 0, 0, 1, 1},
  {&__pyx_n_s_TOE6, __pyx_k_TOE6, sizeof(__pyx_k_TOE6), 0, 0, 1, 1},
  {&__pyx_n_s_TR008, __pyx_k_TR008, sizeof(__pyx_k_TR008), 0, 0, 1, 1},
  {&__pyx_n_s_TRANSPHDLC, __pyx_k_TRANSPHDLC, sizeof(__pyx_k_TRANSPHDLC), 0, 0, 1, 1},
  {&__pyx_n_s_TSO4, __pyx_k_TSO4, sizeof(__pyx_k_TSO4), 0, 0, 1, 1},
  {&__pyx_n_s_TSO6, __pyx_k_TSO6, sizeof(__pyx_k_TSO6), 0, 0, 1, 1},
  {&__pyx_n_s_TUNNEL, __pyx_k_TUNNEL, sizeof(__pyx_k_TUNNEL), 0, 0, 1, 1},
  {&__pyx_n_s_TXCSUM, __pyx_k_TXCSUM, sizeof(__pyx_k_TXCSUM), 0, 0, 1, 1},
  {&__pyx_n_s_TXCSUM_IPV6, __pyx_k_TXCSUM_IPV6, sizeof(__pyx_k_TXCSUM_IPV6), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_ULTRA, __pyx_k_ULTRA, sizeof(__pyx_k_ULTRA), 0, 0, 1, 1},
  {&__pyx_n_s_UNIX, __pyx_k_UNIX, sizeof(__pyx_k_UNIX), 0, 0, 1, 1},
  {&__pyx_n_s_UP, __pyx_k_UP, sizeof(__pyx_k_UP), 0, 0, 1, 1},
  {&__pyx_n_s_USB, __pyx_k_USB, sizeof(__pyx_k_USB), 0, 0, 1, 1},
  {&__pyx_n_s_V11, __pyx_k_V11, sizeof(__pyx_k_V11), 0, 0, 1, 1},
  {&__pyx_n_s_V35, __pyx_k_V35, sizeof(__pyx_k_V35), 0, 0, 1, 1},
  {&__pyx_n_s_V36, __pyx_k_V36, sizeof(__pyx_k_V36), 0, 0, 1, 1},
  {&__pyx_n_s_V37, __pyx_k_V37, sizeof(__pyx_k_V37), 0, 0, 1, 1},
  {&__pyx_n_s_VDSL, __pyx_k_VDSL, sizeof(__pyx_k_VDSL), 0, 0, 1, 1},
  {&__pyx_n_s_VIRTUALIPADDRESS, __pyx_k_VIRTUALIPADDRESS, sizeof(__pyx_k_VIRTUALIPADDRESS), 0, 0, 1, 1},
  {&__pyx_n_s_VLAN_HWCSUM, __pyx_k_VLAN_HWCSUM, sizeof(__pyx_k_VLAN_HWCSUM), 0, 0, 1, 1},
  {&__pyx_n_s_VLAN_HWFILTER, __pyx_k_VLAN_HWFILTER, sizeof(__pyx_k_VLAN_HWFILTER), 0, 0, 1, 1},
  {&__pyx_n_s_VLAN_HWTAGGING, __pyx_k_VLAN_HWTAGGING, sizeof(__pyx_k_VLAN_HWTAGGING), 0, 0, 1, 1},
  {&__pyx_n_s_VLAN_HWTSO, __pyx_k_VLAN_HWTSO, sizeof(__pyx_k_VLAN_HWTSO), 0, 0, 1, 1},
  {&__pyx_n_s_VLAN_MTU, __pyx_k_VLAN_MTU, sizeof(__pyx_k_VLAN_MTU), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEEM, __pyx_k_VOICEEM, sizeof(__pyx_k_VOICEEM), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEENCAP, __pyx_k_VOICEENCAP, sizeof(__pyx_k_VOICEENCAP), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEFXO, __pyx_k_VOICEFXO, sizeof(__pyx_k_VOICEFXO), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEFXS, __pyx_k_VOICEFXS, sizeof(__pyx_k_VOICEFXS), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEOVERATM, __pyx_k_VOICEOVERATM, sizeof(__pyx_k_VOICEOVERATM), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEOVERFRAMERELAY, __pyx_k_VOICEOVERFRAMERELAY, sizeof(__pyx_k_VOICEOVERFRAMERELAY), 0, 0, 1, 1},
  {&__pyx_n_s_VOICEOVERIP, __pyx_k_VOICEOVERIP, sizeof(__pyx_k_VOICEOVERIP), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_WOL_MAGIC, __pyx_k_WOL_MAGIC, sizeof(__pyx_k_WOL_MAGIC), 0, 0, 1, 1},
  {&__pyx_n_s_WOL_MCAST, __pyx_k_WOL_MCAST, sizeof(__pyx_k_WOL_MCAST), 0, 0, 1, 1},
  {&__pyx_n_s_WOL_UCAST, __pyx_k_WOL_UCAST, sizeof(__pyx_k_WOL_UCAST), 0, 0, 1, 1},
  {&__pyx_n_s_WrapSocket, __pyx_k_WrapSocket, sizeof(__pyx_k_WrapSocket), 0, 0, 1, 1},
  {&__pyx_n_s_WrapSocket___enter, __pyx_k_WrapSocket___enter, sizeof(__pyx_k_WrapSocket___enter), 0, 0, 1, 1},
  {&__pyx_n_s_WrapSocket___exit, __pyx_k_WrapSocket___exit, sizeof(__pyx_k_WrapSocket___exit), 0, 0, 1, 1},
  {&__pyx_n_s_X213, __pyx_k_X213, sizeof(__pyx_k_X213), 0, 0, 1, 1},
  {&__pyx_n_s_X25, __pyx_k_X25, sizeof(__pyx_k_X25), 0, 0, 1, 1},
  {&__pyx_n_s_X25DDN, __pyx_k_X25DDN, sizeof(__pyx_k_X25DDN), 0, 0, 1, 1},
  {&__pyx_n_s_X25HUNTGROUP, __pyx_k_X25HUNTGROUP, sizeof(__pyx_k_X25HUNTGROUP), 0, 0, 1, 1},
  {&__pyx_n_s_X25MLP, __pyx_k_X25MLP, sizeof(__pyx_k_X25MLP), 0, 0, 1, 1},
  {&__pyx_n_s_X25PLE, __pyx_k_X25PLE, sizeof(__pyx_k_X25PLE), 0, 0, 1, 1},
  {&__pyx_n_s_XETHER, __pyx_k_XETHER, sizeof(__pyx_k_XETHER), 0, 0, 1, 1},
  {&__pyx_n_s_XRESOLVE, __pyx_k_XRESOLVE, sizeof(__pyx_k_XRESOLVE), 0, 0, 1, 1},
  {&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0},
  {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
  {&__pyx_n_s_active_media_subtype, __pyx_k_active_media_subtype, sizeof(__pyx_k_active_media_subtype), 0, 0, 1, 1},
  {&__pyx_n_s_active_media_type, __pyx_k_active_media_type, sizeof(__pyx_k_active_media_type), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_address, __pyx_k_add_address, sizeof(__pyx_k_add_address), 0, 0, 1, 1},
  {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1},
  {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1},
  {&__pyx_n_s_addresses, __pyx_k_addresses, sizeof(__pyx_k_addresses), 0, 0, 1, 1},
  {&__pyx_n_s_advbase, __pyx_k_advbase, sizeof(__pyx_k_advbase), 0, 0, 1, 1},
  {&__pyx_n_s_advskew, __pyx_k_advskew, sizeof(__pyx_k_advskew), 0, 0, 1, 1},
  {&__pyx_n_s_af, __pyx_k_af, sizeof(__pyx_k_af), 0, 0, 1, 1},
  {&__pyx_n_s_aliases, __pyx_k_aliases, sizeof(__pyx_k_aliases), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_as_buffer, __pyx_k_as_buffer, sizeof(__pyx_k_as_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_bin, __pyx_k_bin, sizeof(__pyx_k_bin), 0, 0, 1, 1},
  {&__pyx_n_s_bitmask_to_set, __pyx_k_bitmask_to_set, sizeof(__pyx_k_bitmask_to_set), 0, 0, 1, 1},
  {&__pyx_n_s_bridge, __pyx_k_bridge, sizeof(__pyx_k_bridge), 0, 0, 1, 1},
  {&__pyx_n_s_broadcast, __pyx_k_broadcast, sizeof(__pyx_k_broadcast), 0, 0, 1, 1},
  {&__pyx_n_s_broadcast_address, __pyx_k_broadcast_address, sizeof(__pyx_k_broadcast_address), 0, 0, 1, 1},
  {&__pyx_n_s_bsd, __pyx_k_bsd, sizeof(__pyx_k_bsd), 0, 0, 1, 1},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_capabilities, __pyx_k_capabilities, sizeof(__pyx_k_capabilities), 0, 0, 1, 1},
  {&__pyx_n_s_carp, __pyx_k_carp, sizeof(__pyx_k_carp), 0, 0, 1, 1},
  {&__pyx_n_s_change, __pyx_k_change, sizeof(__pyx_k_change), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cloned, __pyx_k_cloned, sizeof(__pyx_k_cloned), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_create_interface, __pyx_k_create_interface, sizeof(__pyx_k_create_interface), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_default_route, __pyx_k_default_route, sizeof(__pyx_k_default_route), 0, 0, 1, 1},
  {&__pyx_n_s_default_route_ipv4, __pyx_k_default_route_ipv4, sizeof(__pyx_k_default_route_ipv4), 0, 0, 1, 1},
  {&__pyx_n_s_default_route_ipv6, __pyx_k_default_route_ipv6, sizeof(__pyx_k_default_route_ipv6), 0, 0, 1, 1},
  {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
  {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
  {&__pyx_n_s_dest_address, __pyx_k_dest_address, sizeof(__pyx_k_dest_address), 0, 0, 1, 1},
  {&__pyx_kp_s_dest_address_2, __pyx_k_dest_address_2, sizeof(__pyx_k_dest_address_2), 0, 0, 1, 0},
  {&__pyx_n_s_destroy_interface, __pyx_k_destroy_interface, sizeof(__pyx_k_destroy_interface), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
  {&__pyx_n_s_enumeration, __pyx_k_enumeration, sizeof(__pyx_k_enumeration), 0, 0, 1, 1},
  {&__pyx_n_s_epair, __pyx_k_epair, sizeof(__pyx_k_epair), 0, 0, 1, 1},
  {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
  {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
  {&__pyx_n_s_exc_frame, __pyx_k_exc_frame, sizeof(__pyx_k_exc_frame), 0, 0, 1, 1},
  {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
  {&__pyx_n_s_exc_val, __pyx_k_exc_val, sizeof(__pyx_k_exc_val), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_kp_s_fe80, __pyx_k_fe80, sizeof(__pyx_k_fe80), 0, 0, 1, 0},
  {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1},
  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_force_type, __pyx_k_force_type, sizeof(__pyx_k_force_type), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_gateway, __pyx_k_gateway, sizeof(__pyx_k_gateway), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1},
  {&__pyx_n_s_get_domainname, __pyx_k_get_domainname, sizeof(__pyx_k_get_domainname), 0, 0, 1, 1},
  {&__pyx_n_s_get_hostname, __pyx_k_get_hostname, sizeof(__pyx_k_get_hostname), 0, 0, 1, 1},
  {&__pyx_n_s_get_ifgroup, __pyx_k_get_ifgroup, sizeof(__pyx_k_get_ifgroup), 0, 0, 1, 1},
  {&__pyx_n_s_get_interface, __pyx_k_get_interface, sizeof(__pyx_k_get_interface), 0, 0, 1, 1},
  {&__pyx_kp_s_get_interface_got_an_unexpected, __pyx_k_get_interface_got_an_unexpected, sizeof(__pyx_k_get_interface_got_an_unexpected), 0, 0, 1, 0},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_groupname, __pyx_k_groupname, sizeof(__pyx_k_groupname), 0, 0, 1, 1},
  {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1},
  {&__pyx_n_s_htonl, __pyx_k_htonl, sizeof(__pyx_k_htonl), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_ifa, __pyx_k_ifa, sizeof(__pyx_k_ifa), 0, 0, 1, 1},
  {&__pyx_n_s_ifg, __pyx_k_ifg, sizeof(__pyx_k_ifg), 0, 0, 1, 1},
  {&__pyx_n_s_ifgr, __pyx_k_ifgr, sizeof(__pyx_k_ifgr), 0, 0, 1, 1},
  {&__pyx_n_s_ifname, __pyx_k_ifname, sizeof(__pyx_k_ifname), 0, 0, 1, 1},
  {&__pyx_n_s_ifr, __pyx_k_ifr, sizeof(__pyx_k_ifr), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_interface, __pyx_k_interface, sizeof(__pyx_k_interface), 0, 0, 1, 1},
  {&__pyx_n_s_ip, __pyx_k_ip, sizeof(__pyx_k_ip), 0, 0, 1, 1},
  {&__pyx_n_s_ip_address, __pyx_k_ip_address, sizeof(__pyx_k_ip_address), 0, 0, 1, 1},
  {&__pyx_n_s_ipaddress, __pyx_k_ipaddress, sizeof(__pyx_k_ipaddress), 0, 0, 1, 1},
  {&__pyx_n_s_ipv6_flags, __pyx_k_ipv6_flags, sizeof(__pyx_k_ipv6_flags), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_itype, __pyx_k_itype, sizeof(__pyx_k_itype), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_lagg, __pyx_k_lagg, sizeof(__pyx_k_lagg), 0, 0, 1, 1},
  {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_link_address, __pyx_k_link_address, sizeof(__pyx_k_link_address), 0, 0, 1, 1},
  {&__pyx_n_s_link_state, __pyx_k_link_state, sizeof(__pyx_k_link_state), 0, 0, 1, 1},
  {&__pyx_kp_s_link_state_2, __pyx_k_link_state_2, sizeof(__pyx_k_link_state_2), 0, 0, 1, 0},
  {&__pyx_n_s_list_interfaces, __pyx_k_list_interfaces, sizeof(__pyx_k_list_interfaces), 0, 0, 1, 1},
  {&__pyx_n_s_list_interfaces_internal_locals, __pyx_k_list_interfaces_internal_locals, sizeof(__pyx_k_list_interfaces_internal_locals), 0, 0, 1, 1},
  {&__pyx_n_s_lo, __pyx_k_lo, sizeof(__pyx_k_lo), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_media_options, __pyx_k_media_options, sizeof(__pyx_k_media_options), 0, 0, 1, 1},
  {&__pyx_n_s_media_subtype, __pyx_k_media_subtype, sizeof(__pyx_k_media_subtype), 0, 0, 1, 1},
  {&__pyx_n_s_media_type, __pyx_k_media_type, sizeof(__pyx_k_media_type), 0, 0, 1, 1},
  {&__pyx_n_s_mem, __pyx_k_mem, sizeof(__pyx_k_mem), 0, 0, 1, 1},
  {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
  {&__pyx_n_s_mtu, __pyx_k_mtu, sizeof(__pyx_k_mtu), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
  {&__pyx_n_s_nd6_flags, __pyx_k_nd6_flags, sizeof(__pyx_k_nd6_flags), 0, 0, 1, 1},
  {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1},
  {&__pyx_n_s_netif, __pyx_k_netif, sizeof(__pyx_k_netif), 0, 0, 1, 1},
  {&__pyx_kp_s_netif_0_name_1_type_2, __pyx_k_netif_0_name_1_type_2, sizeof(__pyx_k_netif_0_name_1_type_2), 0, 0, 1, 0},
  {&__pyx_n_s_netmask, __pyx_k_netmask, sizeof(__pyx_k_netmask), 0, 0, 1, 1},
  {&__pyx_n_s_network, __pyx_k_network, sizeof(__pyx_k_network), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_newdomainname, __pyx_k_newdomainname, sizeof(__pyx_k_newdomainname), 0, 0, 1, 1},
  {&__pyx_n_s_newhostname, __pyx_k_newhostname, sizeof(__pyx_k_newhostname), 0, 0, 1, 1},
  {&__pyx_n_s_ntohl, __pyx_k_ntohl, sizeof(__pyx_k_ntohl), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_packed, __pyx_k_packed, sizeof(__pyx_k_packed), 0, 0, 1, 1},
  {&__pyx_n_s_packet, __pyx_k_packet, sizeof(__pyx_k_packet), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1},
  {&__pyx_n_s_ports, __pyx_k_ports, sizeof(__pyx_k_ports), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1},
  {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_read_message, __pyx_k_read_message, sizeof(__pyx_k_read_message), 0, 0, 1, 1},
  {&__pyx_n_s_remove_address, __pyx_k_remove_address, sizeof(__pyx_k_remove_address), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
  {&__pyx_n_s_route, __pyx_k_route, sizeof(__pyx_k_route), 0, 0, 1, 1},
  {&__pyx_n_s_routes, __pyx_k_routes, sizeof(__pyx_k_routes), 0, 0, 1, 1},
  {&__pyx_n_s_rt_msg, __pyx_k_rt_msg, sizeof(__pyx_k_rt_msg), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_n_s_scope, __pyx_k_scope, sizeof(__pyx_k_scope), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_send_message, __pyx_k_send_message, sizeof(__pyx_k_send_message), 0, 0, 1, 1},
  {&__pyx_n_s_send_route, __pyx_k_send_route, sizeof(__pyx_k_send_route), 0, 0, 1, 1},
  {&__pyx_n_s_set_domainname, __pyx_k_set_domainname, sizeof(__pyx_k_set_domainname), 0, 0, 1, 1},
  {&__pyx_n_s_set_hostname, __pyx_k_set_hostname, sizeof(__pyx_k_set_hostname), 0, 0, 1, 1},
  {&__pyx_n_s_set_to_bitmask, __pyx_k_set_to_bitmask, sizeof(__pyx_k_set_to_bitmask), 0, 0, 1, 1},
  {&__pyx_n_s_sock, __pyx_k_sock, sizeof(__pyx_k_sock), 0, 0, 1, 1},
  {&__pyx_n_s_sock3, __pyx_k_sock3, sizeof(__pyx_k_sock3), 0, 0, 1, 1},
  {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_static_routes, __pyx_k_static_routes, sizeof(__pyx_k_static_routes), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sysctl, __pyx_k_sysctl, sizeof(__pyx_k_sysctl), 0, 0, 1, 1},
  {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
  {&__pyx_n_s_tap, __pyx_k_tap, sizeof(__pyx_k_tap), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 0, 0, 1, 1},
  {&__pyx_n_s_tun, __pyx_k_tun, sizeof(__pyx_k_tun), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_typemap, __pyx_k_typemap, sizeof(__pyx_k_typemap), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_vhid, __pyx_k_vhid, sizeof(__pyx_k_vhid), 0, 0, 1, 1},
  {&__pyx_n_s_vlan, __pyx_k_vlan, sizeof(__pyx_k_vlan), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_write_message, __pyx_k_write_message, sizeof(__pyx_k_write_message), 0, 0, 1, 1},
  {&__pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_k_wrkdirs_usr_ports_net_py_netif, sizeof(__pyx_k_wrkdirs_usr_ports_net_py_netif), 0, 0, 1, 0},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 469, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 1617, __pyx_L1_error)
  __pyx_builtin_bin = __Pyx_GetBuiltinName(__pyx_n_s_bin); if (!__pyx_builtin_bin) __PYX_ERR(0, 527, __pyx_L1_error)
  __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 622, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 651, __pyx_L1_error)
  __pyx_builtin_filter = __Pyx_GetBuiltinName(__pyx_n_s_filter); if (!__pyx_builtin_filter) __PYX_ERR(0, 770, __pyx_L1_error)
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 923, __pyx_L1_error)
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 923, __pyx_L1_error)
  #endif
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 1017, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1072, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 1954, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 1984, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "netif.pyx":527
 *         if self.netmask:
 *             # XXX yuck!
 *             ret['netmask'] = bin(int(self.netmask)).count('1')             # <<<<<<<<<<<<<<
 * 
 *         if self.broadcast:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "netif.pyx":566
 *     def __init__(self, name):
 *         self.name = name
 *         self.nameb = name.encode('ascii')             # <<<<<<<<<<<<<<
 *         self.addresses = []
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "netif.pyx":585
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *             result = defs.ioctl(s.fileno(), cmd, args)
 *         return result
 */
  __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "netif.pyx":631
 * 
 *             # Address
 *             packed = address.address.packed[:16]             # <<<<<<<<<<<<<<
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_addr
 *             sin6.sin6_family = defs.AF_INET6
 */
  __pyx_slice__5 = PySlice_New(Py_None, __pyx_int_16, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__5);
  __Pyx_GIVEREF(__pyx_slice__5);

  /* "netif.pyx":638
 * 
 *             # Netmask
 *             packed = address.netmask.packed[:16]             # <<<<<<<<<<<<<<
 *             sin6 = <defs.sockaddr_in6*>&req6.ifra_prefixmask
 *             sin6.sin6_family = defs.AF_INET6
 */
  __pyx_slice__6 = PySlice_New(Py_None, __pyx_int_16, Py_None); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__6);
  __Pyx_GIVEREF(__pyx_slice__6);

  /* "netif.pyx":896
 *             memset(&ifr, 0, cython.sizeof(ifr))
 *             strcpy(ifr.ifr_name, self.nameb)
 *             strcpy(buffer, descr.encode('utf-8'))             # <<<<<<<<<<<<<<
 *             ifr.ifr_ifru.ifru_buffer.length = cython.sizeof(buffer)
 *             ifr.ifr_ifru.ifru_buffer.buffer = buffer
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "netif.pyx":995
 *         memset(&ifr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(newname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t><void*>newname
 * 
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "netif.pyx":1002
 * 
 *         self.name = name
 *         self.nameb = name.encode('ascii')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "netif.pyx":1029
 *         memset(&lreq, 0, cython.sizeof(lreq))
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSLAGGPORT, <void*>&lreq) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "netif.pyx":1037
 *         memset(&lreq, 0, cython.sizeof(lreq))
 *         strcpy(lreq.rp_ifname, self.nameb)
 *         strcpy(lreq.rp_portname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         if self.ioctl(defs.SIOCSLAGGDELPORT, <void*>&lreq) == -1:
 *             raise OSError(errno, os.strerror(errno))
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "netif.pyx":1088
 *         cdef defs.ifbreq ifbr
 * 
 *         strcpy(ifbr.ifbr_ifsname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         self.bridge_cmd(defs.BRDGADD, &ifbr, cython.sizeof(ifbr), True)
 * 
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "netif.pyx":1094
 *         cdef defs.ifbreq ifbr
 * 
 *         strcpy(ifbr.ifbr_ifsname, name.encode('ascii'))             # <<<<<<<<<<<<<<
 *         self.bridge_cmd(defs.BRDGDEL, &ifbr, cython.sizeof(ifbr), True)
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "netif.pyx":1162
 *         memset(&vlr, 0, cython.sizeof(ifr))
 *         strcpy(ifr.ifr_name, self.nameb)
 *         strcpy(vlr.vlr_parent, parent.encode('ascii'))             # <<<<<<<<<<<<<<
 *         vlr.vlr_tag = tag
 *         ifr.ifr_ifru.ifru_data = <defs.caddr_t>&vlr
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "netif.pyx":1241
 *         result = {}
 * 
 *         for i in range(0, 7):             # <<<<<<<<<<<<<<
 *             if not mask & (1 << i):
 *                 continue
 */
  __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_7); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "netif.pyx":1268
 *                     # default route
 *                     if addr_sa_family == defs.AF_INET:
 *                         result[i] = ipaddress.ip_address(u'0.0.0.0')             # <<<<<<<<<<<<<<
 * 
 *                     if addr_sa_family == defs.AF_INET6:
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_0_0_0_0); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "netif.pyx":1271
 * 
 *                     if addr_sa_family == defs.AF_INET6:
 *                         result[i] = ipaddress.ip_address(u'::')             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u__18); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "netif.pyx":1544
 * 
 *         def __set__(self, value):
 *             self.rt_msg.rtm_index = defs.if_nametoindex(value.encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *     property network:
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "netif.pyx":1705
 *     @property
 *     def default_route(self):
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))             # <<<<<<<<<<<<<<
 *         return f[0] if f else None
 * 
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_0_0_0_0); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "netif.pyx":1710
 *     @property
 *     def static_routes(self):
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))             # <<<<<<<<<<<<<<
 * 
 *     def add(self, route):
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_0_0_0_0); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "netif.pyx":1766
 *     cdef char *mem
 * 
 *     groupname = groupname.encode('ascii')             # <<<<<<<<<<<<<<
 *     result = []
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "netif.pyx":1768
 *     groupname = groupname.encode('ascii')
 *     result = []
 *     with sock3(socket.AF_UNIX, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *         memset(&ifgr, 0, cython.sizeof(ifgr))
 *         strcpy(ifgr.ifgr_name, groupname)
 */
  __pyx_tuple__24 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_tuple__25 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "netif.pyx":1799
 *     strcpy(ifr6.ifr_name, name)
 *     ifr6.ifr_ifru.ifru_addr = sin6[0]
 *     with sock3(socket.AF_INET6, socket.SOCK_DGRAM) as s:             # <<<<<<<<<<<<<<
 *         if defs.ioctl(s.fileno(), defs.SIOCGIFAFLAG_IN6, <void*>&ifr6) == -1:
 *             return -1
 */
  __pyx_tuple__26 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);
  __pyx_tuple__27 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "netif.pyx":1821
 *         # the last one here overrides due to the update().
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_vlan); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "netif.pyx":1822
 *         typemap = {}
 *         typemap.update(dict((i, VlanInterface) for i in get_ifgroup('vlan')))
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))             # <<<<<<<<<<<<<<
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_lagg); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "netif.pyx":1824
 *         typemap.update(dict((i, LaggInterface) for i in get_ifgroup('lagg')))
 *         typemap.update(dict((i, BridgeInterface)
 *                             for i in get_ifgroup('bridge')))             # <<<<<<<<<<<<<<
 * 
 *     result = {}
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_bridge); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "netif.pyx":1838
 * 
 *             iface.name = name
 *             iface.nameb = name.encode('ascii')             # <<<<<<<<<<<<<<
 *             iface.addresses = []
 *             result[name] = iface
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "netif.pyx":1881
 *                 if ia6_flags != -1:
 *                     addr.ipv6_flags = bitmask_to_set(ia6_flags, In6AddrFlags)
 *                 if str(addr.address).startswith('fe80:'):             # <<<<<<<<<<<<<<
 *                     addr.scope = sin6.sin6_scope_id
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_fe80); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "netif.pyx":1981
 *     """
 *     typemap = None
 *     if kwargs.pop('bridge', False):             # <<<<<<<<<<<<<<
 *         force_type = 'bridge'
 *     if kwargs:
 */
  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_bridge, Py_False); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "netif.pyx":1998
 * def create_interface(name):
 *     """create new cloned interface (vlan, lagg, bridge)"""
 *     name = name.encode('ascii')             # <<<<<<<<<<<<<<
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "netif.pyx":2000
 *     name = name.encode('ascii')
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFCREATE, <void*>&ifr) == -1:
 */
  __pyx_tuple__35 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "netif.pyx":2009
 * def destroy_interface(name):
 *     """destroy specified interface (probably should only use on clones)"""
 *     name = name.encode('ascii')             # <<<<<<<<<<<<<<
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "netif.pyx":2011
 *     name = name.encode('ascii')
 *     cdef defs.ifreq ifr
 *     with sock3(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         strcpy(ifr.ifr_name, name)
 *         if defs.ioctl(s.fileno(), defs.SIOCIFDESTROY, <void*>&ifr) == -1:
 */
  __pyx_tuple__37 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "netif.pyx":2028
 * 
 * def set_hostname(newhostname):
 *     newhostname = newhostname.encode('ascii')             # <<<<<<<<<<<<<<
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 *         raise OSError(errno, os.strerror(errno))
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "netif.pyx":2043
 * 
 * def set_domainname(newdomainname):
 *     newdomainname = newdomainname.encode('ascii')             # <<<<<<<<<<<<<<
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 *         raise OSError(errno, os.strerror(errno))
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 2043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "netif.pyx":470
 * 
 * class LinkAddress(object):
 *     def __init__(self, ifname=None, address=None):             # <<<<<<<<<<<<<<
 *         self.ifname = ifname
 *         self.address = address
 */
  __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ifname, __pyx_n_s_address); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_init, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 470, __pyx_L1_error)
  __pyx_tuple__42 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "netif.pyx":474
 *         self.address = address
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.address
 * 
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_str, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 474, __pyx_L1_error)

  /* "netif.pyx":477
 *         return self.address
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'ifname': self.ifname,
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_getstate, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 477, __pyx_L1_error)

  /* "netif.pyx":483
 *         }
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.ifname, self.address))
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_hash, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 483, __pyx_L1_error)

  /* "netif.pyx":486
 *         return hash((self.ifname, self.address))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.ifname == other.ifname and \
 */
  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_eq, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 486, __pyx_L1_error)

  /* "netif.pyx":491
 *             self.address == other.address
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */
  __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_ne, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 491, __pyx_L1_error)

  /* "netif.pyx":496
 * 
 * class InterfaceAddress(object):
 *     def __init__(self, af=None, address=None):             # <<<<<<<<<<<<<<
 *         self.af = af
 * 
 */
  __pyx_tuple__53 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_af, __pyx_n_s_address); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_init, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_tuple__55 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "netif.pyx":513
 *         self.vhid = None
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_str, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 513, __pyx_L1_error)

  /* "netif.pyx":516
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_hash, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 516, __pyx_L1_error)

  /* "netif.pyx":519
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         ret = {
 *             'type': self.af.name,
 */
  __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_getstate, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 519, __pyx_L1_error)

  /* "netif.pyx":534
 *         return ret
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.af == other.af and \
 */
  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_eq, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 534, __pyx_L1_error)

  /* "netif.pyx":543
 *             self.vhid == other.vhid
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */
  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_ne, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 543, __pyx_L1_error)

  /* "netif.pyx":549
 * if not hasattr(socket.socket, '__enter__'):
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):             # <<<<<<<<<<<<<<
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_enter, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 549, __pyx_L1_error)

  /* "netif.pyx":551
 *         def __enter__(self):
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_tuple__68 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_frame); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_exit, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 551, __pyx_L1_error)

  /* "netif.pyx":1006
 * 
 * class CarpConfig(object):
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):             # <<<<<<<<<<<<<<
 *         self.vhid = vhid
 *         self.addr = addr
 */
  __pyx_tuple__70 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_vhid, __pyx_n_s_addr, __pyx_n_s_advbase, __pyx_n_s_advskew, __pyx_n_s_key, __pyx_n_s_state); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_init, 1006, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __pyx_tuple__72 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "netif.pyx":1598
 * 
 * class Route(object):
 *     def __init__(self, network, netmask, gateway=None, interface=None):             # <<<<<<<<<<<<<<
 *         self.network = ipaddress.ip_address(network)
 *         self.netmask = None
 */
  __pyx_tuple__73 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_network, __pyx_n_s_netmask, __pyx_n_s_gateway, __pyx_n_s_interface); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_init, 1598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __pyx_tuple__75 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "netif.pyx":1618
 * 
 *     @property
 *     def af(self):             # <<<<<<<<<<<<<<
 *         if not self.network:
 *             return None
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_af, 1618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 1618, __pyx_L1_error)

  /* "netif.pyx":1630
 *         return None
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'network': str(self.network),
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_x); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_getstate, 1630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 1630, __pyx_L1_error)

  /* "netif.pyx":1639
 *         }
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, Route):
 *             return False
 */
  __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_eq, 1639, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 1639, __pyx_L1_error)

  /* "netif.pyx":1647
 *             self.gateway == other.gateway
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */
  __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_ne, 1647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 1647, __pyx_L1_error)

  /* "netif.pyx":1650
 *         return not self == other
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((
 *             self.network,
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_hash, 1650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 1650, __pyx_L1_error)

  /* "netif.pyx":1659
 * 
 * class RoutingTable(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_init, 1659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 1659, __pyx_L1_error)

  /* "netif.pyx":1662
 *         pass
 * 
 *     def __send_message(self, msg):             # <<<<<<<<<<<<<<
 *         if msg.type == RoutingMessageType.DELETE:
 *             msg.gateway = None
 */
  __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_msg, __pyx_n_s_sock); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_send_message, 1662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 1662, __pyx_L1_error)

  /* "netif.pyx":1671
 *         sock.close()
 * 
 *     def __send_route(self, type, route):             # <<<<<<<<<<<<<<
 *         msg = RoutingMessage()
 *         msg.type = type
 */
  __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_route, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_send_route, 1671, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1671, __pyx_L1_error)

  /* "netif.pyx":1678
 * 
 *     @property
 *     def default_route_ipv4(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 *         return f[0] if len(f) > 0 else None
 */
  __pyx_tuple__92 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_f); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_default_route_ipv4, 1678, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 1678, __pyx_L1_error)

  /* "netif.pyx":1683
 * 
 *     @property
 *     def default_route_ipv6(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 *         return f[0] if len(f) > 0 else None
 */
  __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_f); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_default_route_ipv6, 1683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 1683, __pyx_L1_error)

  /* "netif.pyx":1688
 * 
 *     @property
 *     def routes(self):             # <<<<<<<<<<<<<<
 *         cdef char* buf
 *         cdef defs.rt_msghdr* rt_msg
 */
  __pyx_tuple__96 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_rt_msg, __pyx_n_s_data, __pyx_n_s_ptr, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_routes, 1688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 1688, __pyx_L1_error)

  /* "netif.pyx":1704
 * 
 *     @property
 *     def default_route(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 *         return f[0] if f else None
 */
  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_f); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 1704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_default_route, 1704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 1704, __pyx_L1_error)

  /* "netif.pyx":1709
 * 
 *     @property
 *     def static_routes(self):             # <<<<<<<<<<<<<<
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_static_routes, 1709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 1709, __pyx_L1_error)

  /* "netif.pyx":1712
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 *     def add(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 */
  __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_route); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_add, 1712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 1712, __pyx_L1_error)

  /* "netif.pyx":1715
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 *     def delete(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 */
  __pyx_tuple__104 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_route); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_delete, 1715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 1715, __pyx_L1_error)

  /* "netif.pyx":1718
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 *     def change(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.CHANGE, route)
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_route); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_change, 1718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 1718, __pyx_L1_error)

  /* "netif.pyx":1723
 * 
 * class RoutingSocket(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.socket = None
 * 
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_init, 1723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 1723, __pyx_L1_error)

  /* "netif.pyx":1726
 *         self.socket = None
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_open, 1726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 1726, __pyx_L1_error)

  /* "netif.pyx":1729
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.socket.close()
 * 
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_close, 1729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 1729, __pyx_L1_error)

  /* "netif.pyx":1732
 *         self.socket.close()
 * 
 *     def read_message(self):             # <<<<<<<<<<<<<<
 *         cdef char* buffer
 *         cdef defs.rt_msghdr* rt_msg
 */
  __pyx_tuple__114 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_buffer, __pyx_n_s_rt_msg, __pyx_n_s_packet); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_read_message, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 1732, __pyx_L1_error)

  /* "netif.pyx":1755
 *         return RoutingMessage(packet)
 * 
 *     def write_message(self, message):             # <<<<<<<<<<<<<<
 *         buf = message.as_buffer()
 *         os.write(self.socket.fileno(), buf)
 */
  __pyx_tuple__116 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_write_message, 1755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 1755, __pyx_L1_error)

  /* "netif.pyx":1759
 *         os.write(self.socket.fileno(), buf)
 * 
 * def get_ifgroup(groupname):             # <<<<<<<<<<<<<<
 *     """Given group name such as vnet or bridge, get group members"""
 *     cdef defs.ifgroupreq ifgr
 */
  __pyx_tuple__118 = PyTuple_Pack(7, __pyx_n_s_groupname, __pyx_n_s_ifgr, __pyx_n_s_ifg, __pyx_n_s_len, __pyx_n_s_mem, __pyx_n_s_result, __pyx_n_s_s); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_get_ifgroup, 1759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 1759, __pyx_L1_error)

  /* "netif.pyx":1914
 *     return result
 * 
 * def list_interfaces(names=None, typemap=None):             # <<<<<<<<<<<<<<
 *     """
 *     Return a dictionary of all interfaces in the system.
 */
  __pyx_tuple__120 = PyTuple_Pack(3, __pyx_n_s_names, __pyx_n_s_typemap, __pyx_n_s_ifa); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_list_interfaces, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 1914, __pyx_L1_error)

  /* "netif.pyx":1948
 *         defs.freeifaddrs(ifa)
 * 
 * def bitmask_to_set(n, enumeration):             # <<<<<<<<<<<<<<
 *     result = set()
 *     while n:
 */
  __pyx_tuple__122 = PyTuple_Pack(4, __pyx_n_s_n, __pyx_n_s_enumeration, __pyx_n_s_result, __pyx_n_s_b); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_bitmask_to_set, 1948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 1948, __pyx_L1_error)

  /* "netif.pyx":1962
 * 
 * 
 * def set_to_bitmask(value):             # <<<<<<<<<<<<<<
 *     result = 0
 *     for i in value:
 */
  __pyx_tuple__124 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_result, __pyx_n_s_i); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_set_to_bitmask, 1962, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 1962, __pyx_L1_error)

  /* "netif.pyx":1970
 * 
 * 
 * def get_interface(name, force_type=None, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Get the given interface.  Raises KeyError if interface does
 */
  __pyx_tuple__126 = PyTuple_Pack(5, __pyx_n_s_name, __pyx_n_s_force_type, __pyx_n_s_kwargs, __pyx_n_s_typemap, __pyx_n_s_itype); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_get_interface, 1970, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 1970, __pyx_L1_error)

  /* "netif.pyx":1996
 * 
 * 
 * def create_interface(name):             # <<<<<<<<<<<<<<
 *     """create new cloned interface (vlan, lagg, bridge)"""
 *     name = name.encode('ascii')
 */
  __pyx_tuple__128 = PyTuple_Pack(3, __pyx_n_s_name, __pyx_n_s_ifr, __pyx_n_s_s); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_create_interface, 1996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1996, __pyx_L1_error)

  /* "netif.pyx":2007
 * 
 * 
 * def destroy_interface(name):             # <<<<<<<<<<<<<<
 *     """destroy specified interface (probably should only use on clones)"""
 *     name = name.encode('ascii')
 */
  __pyx_tuple__130 = PyTuple_Pack(3, __pyx_n_s_name, __pyx_n_s_ifr, __pyx_n_s_s); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_destroy_interface, 2007, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 2007, __pyx_L1_error)

  /* "netif.pyx":2018
 * 
 * 
 * def get_hostname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_get_hostname, 2018, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 2018, __pyx_L1_error)

  /* "netif.pyx":2027
 * 
 * 
 * def set_hostname(newhostname):             # <<<<<<<<<<<<<<
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_n_s_newhostname); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_set_hostname, 2027, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 2027, __pyx_L1_error)

  /* "netif.pyx":2033
 * 
 * 
 * def get_domainname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 2033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_get_domainname, 2033, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 2033, __pyx_L1_error)

  /* "netif.pyx":2042
 * 
 * 
 * def set_domainname(newdomainname):             # <<<<<<<<<<<<<<
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_newdomainname); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 2042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_wrkdirs_usr_ports_net_py_netif, __pyx_n_s_set_domainname, 2042, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 2042, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initnetif(void); /*proto*/
PyMODINIT_FUNC initnetif(void)
#else
PyMODINIT_FUNC PyInit_netif(void); /*proto*/
PyMODINIT_FUNC PyInit_netif(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_netif(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("netif", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_netif) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "netif")) {
      if (unlikely(PyDict_SetItemString(modules, "netif", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5netif_NetworkInterface = &__pyx_vtable_5netif_NetworkInterface;
  __pyx_vtable_5netif_NetworkInterface.query_media = (int (*)(struct __pyx_obj_5netif_NetworkInterface *, struct ifmediareq *))__pyx_f_5netif_16NetworkInterface_query_media;
  __pyx_vtable_5netif_NetworkInterface.ioctl = (int (*)(struct __pyx_obj_5netif_NetworkInterface *, uint32_t, void *, struct __pyx_opt_args_5netif_16NetworkInterface_ioctl *__pyx_optional_args))__pyx_f_5netif_16NetworkInterface_ioctl;
  __pyx_vtable_5netif_NetworkInterface.aliasreq = (PyObject *(*)(struct __pyx_obj_5netif_NetworkInterface *, PyObject *, uint32_t))__pyx_f_5netif_16NetworkInterface_aliasreq;
  __pyx_vtable_5netif_NetworkInterface.__pyx___get_flags = (uint32_t (*)(struct __pyx_obj_5netif_NetworkInterface *))__pyx_f_5netif_16NetworkInterface___get_flags;
  __pyx_vtable_5netif_NetworkInterface.__pyx___rw_nd6_flags = (uint32_t (*)(struct __pyx_obj_5netif_NetworkInterface *, struct __pyx_opt_args_5netif_16NetworkInterface___rw_nd6_flags *__pyx_optional_args))__pyx_f_5netif_16NetworkInterface___rw_nd6_flags;
  if (PyType_Ready(&__pyx_type_5netif_NetworkInterface) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __pyx_type_5netif_NetworkInterface.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_NetworkInterface.tp_dict, __pyx_vtabptr_5netif_NetworkInterface) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "NetworkInterface", (PyObject *)&__pyx_type_5netif_NetworkInterface) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __pyx_ptype_5netif_NetworkInterface = &__pyx_type_5netif_NetworkInterface;
  __pyx_vtabptr_5netif_LaggInterface = &__pyx_vtable_5netif_LaggInterface;
  __pyx_vtable_5netif_LaggInterface.__pyx_base = *__pyx_vtabptr_5netif_NetworkInterface;
  __pyx_type_5netif_LaggInterface.tp_base = __pyx_ptype_5netif_NetworkInterface;
  if (PyType_Ready(&__pyx_type_5netif_LaggInterface) < 0) __PYX_ERR(0, 1015, __pyx_L1_error)
  __pyx_type_5netif_LaggInterface.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_LaggInterface.tp_dict, __pyx_vtabptr_5netif_LaggInterface) < 0) __PYX_ERR(0, 1015, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "LaggInterface", (PyObject *)&__pyx_type_5netif_LaggInterface) < 0) __PYX_ERR(0, 1015, __pyx_L1_error)
  __pyx_ptype_5netif_LaggInterface = &__pyx_type_5netif_LaggInterface;
  __pyx_vtabptr_5netif_BridgeInterface = &__pyx_vtable_5netif_BridgeInterface;
  __pyx_vtable_5netif_BridgeInterface.__pyx_base = *__pyx_vtabptr_5netif_NetworkInterface;
  __pyx_vtable_5netif_BridgeInterface.bridge_cmd = (PyObject *(*)(struct __pyx_obj_5netif_BridgeInterface *, PyObject *, void *, size_t, int))__pyx_f_5netif_15BridgeInterface_bridge_cmd;
  __pyx_type_5netif_BridgeInterface.tp_base = __pyx_ptype_5netif_NetworkInterface;
  if (PyType_Ready(&__pyx_type_5netif_BridgeInterface) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
  __pyx_type_5netif_BridgeInterface.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_BridgeInterface.tp_dict, __pyx_vtabptr_5netif_BridgeInterface) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "BridgeInterface", (PyObject *)&__pyx_type_5netif_BridgeInterface) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
  __pyx_ptype_5netif_BridgeInterface = &__pyx_type_5netif_BridgeInterface;
  __pyx_vtabptr_5netif_VlanInterface = &__pyx_vtable_5netif_VlanInterface;
  __pyx_vtable_5netif_VlanInterface.__pyx_base = *__pyx_vtabptr_5netif_NetworkInterface;
  __pyx_vtable_5netif_VlanInterface.get_vlan = (PyObject *(*)(struct __pyx_obj_5netif_VlanInterface *))__pyx_f_5netif_13VlanInterface_get_vlan;
  __pyx_type_5netif_VlanInterface.tp_base = __pyx_ptype_5netif_NetworkInterface;
  if (PyType_Ready(&__pyx_type_5netif_VlanInterface) < 0) __PYX_ERR(0, 1133, __pyx_L1_error)
  __pyx_type_5netif_VlanInterface.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_VlanInterface.tp_dict, __pyx_vtabptr_5netif_VlanInterface) < 0) __PYX_ERR(0, 1133, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "VlanInterface", (PyObject *)&__pyx_type_5netif_VlanInterface) < 0) __PYX_ERR(0, 1133, __pyx_L1_error)
  __pyx_ptype_5netif_VlanInterface = &__pyx_type_5netif_VlanInterface;
  __pyx_vtabptr_5netif_RoutingPacket = &__pyx_vtable_5netif_RoutingPacket;
  __pyx_vtable_5netif_RoutingPacket._grow = (PyObject *(*)(struct __pyx_obj_5netif_RoutingPacket *, PyObject *))__pyx_f_5netif_13RoutingPacket__grow;
  __pyx_vtable_5netif_RoutingPacket._align_sa_len = (PyObject *(*)(struct __pyx_obj_5netif_RoutingPacket *, int))__pyx_f_5netif_13RoutingPacket__align_sa_len;
  __pyx_vtable_5netif_RoutingPacket._parse_sockaddr_dl = (PyObject *(*)(struct __pyx_obj_5netif_RoutingPacket *, struct sockaddr_dl *))__pyx_f_5netif_13RoutingPacket__parse_sockaddr_dl;
  __pyx_vtable_5netif_RoutingPacket._parse_sockaddrs = (PyObject *(*)(struct __pyx_obj_5netif_RoutingPacket *, int, int))__pyx_f_5netif_13RoutingPacket__parse_sockaddrs;
  __pyx_vtable_5netif_RoutingPacket._pack_sockaddrs = (PyObject *(*)(struct __pyx_obj_5netif_RoutingPacket *, int, PyObject *))__pyx_f_5netif_13RoutingPacket__pack_sockaddrs;
  if (PyType_Ready(&__pyx_type_5netif_RoutingPacket) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
  __pyx_type_5netif_RoutingPacket.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_RoutingPacket.tp_dict, __pyx_vtabptr_5netif_RoutingPacket) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "RoutingPacket", (PyObject *)&__pyx_type_5netif_RoutingPacket) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
  __pyx_ptype_5netif_RoutingPacket = &__pyx_type_5netif_RoutingPacket;
  __pyx_vtabptr_5netif_InterfaceAnnounceMessage = &__pyx_vtable_5netif_InterfaceAnnounceMessage;
  __pyx_vtable_5netif_InterfaceAnnounceMessage.__pyx_base = *__pyx_vtabptr_5netif_RoutingPacket;
  __pyx_type_5netif_InterfaceAnnounceMessage.tp_base = __pyx_ptype_5netif_RoutingPacket;
  if (PyType_Ready(&__pyx_type_5netif_InterfaceAnnounceMessage) < 0) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_type_5netif_InterfaceAnnounceMessage.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_InterfaceAnnounceMessage.tp_dict, __pyx_vtabptr_5netif_InterfaceAnnounceMessage) < 0) __PYX_ERR(0, 1349, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "InterfaceAnnounceMessage", (PyObject *)&__pyx_type_5netif_InterfaceAnnounceMessage) < 0) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_ptype_5netif_InterfaceAnnounceMessage = &__pyx_type_5netif_InterfaceAnnounceMessage;
  __pyx_vtabptr_5netif_InterfaceInfoMessage = &__pyx_vtable_5netif_InterfaceInfoMessage;
  __pyx_vtable_5netif_InterfaceInfoMessage.__pyx_base = *__pyx_vtabptr_5netif_RoutingPacket;
  __pyx_type_5netif_InterfaceInfoMessage.tp_base = __pyx_ptype_5netif_RoutingPacket;
  if (PyType_Ready(&__pyx_type_5netif_InterfaceInfoMessage) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
  __pyx_type_5netif_InterfaceInfoMessage.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_InterfaceInfoMessage.tp_dict, __pyx_vtabptr_5netif_InterfaceInfoMessage) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "InterfaceInfoMessage", (PyObject *)&__pyx_type_5netif_InterfaceInfoMessage) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
  __pyx_ptype_5netif_InterfaceInfoMessage = &__pyx_type_5netif_InterfaceInfoMessage;
  __pyx_vtabptr_5netif_InterfaceAddrMessage = &__pyx_vtable_5netif_InterfaceAddrMessage;
  __pyx_vtable_5netif_InterfaceAddrMessage.__pyx_base = *__pyx_vtabptr_5netif_RoutingPacket;
  __pyx_type_5netif_InterfaceAddrMessage.tp_base = __pyx_ptype_5netif_RoutingPacket;
  if (PyType_Ready(&__pyx_type_5netif_InterfaceAddrMessage) < 0) __PYX_ERR(0, 1415, __pyx_L1_error)
  __pyx_type_5netif_InterfaceAddrMessage.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_InterfaceAddrMessage.tp_dict, __pyx_vtabptr_5netif_InterfaceAddrMessage) < 0) __PYX_ERR(0, 1415, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "InterfaceAddrMessage", (PyObject *)&__pyx_type_5netif_InterfaceAddrMessage) < 0) __PYX_ERR(0, 1415, __pyx_L1_error)
  __pyx_ptype_5netif_InterfaceAddrMessage = &__pyx_type_5netif_InterfaceAddrMessage;
  __pyx_vtabptr_5netif_RoutingMessage = &__pyx_vtable_5netif_RoutingMessage;
  __pyx_vtable_5netif_RoutingMessage.__pyx_base = *__pyx_vtabptr_5netif_RoutingPacket;
  __pyx_type_5netif_RoutingMessage.tp_base = __pyx_ptype_5netif_RoutingPacket;
  if (PyType_Ready(&__pyx_type_5netif_RoutingMessage) < 0) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_type_5netif_RoutingMessage.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5netif_RoutingMessage.tp_dict, __pyx_vtabptr_5netif_RoutingMessage) < 0) __PYX_ERR(0, 1478, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "RoutingMessage", (PyObject *)&__pyx_type_5netif_RoutingMessage) < 0) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_ptype_5netif_RoutingMessage = &__pyx_type_5netif_RoutingMessage;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct____get__) < 0) __PYX_ERR(0, 904, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct____get__.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct____get__ = &__pyx_type_5netif___pyx_scope_struct____get__;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct_1___get__) < 0) __PYX_ERR(0, 1060, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct_1___get__.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct_1___get__ = &__pyx_type_5netif___pyx_scope_struct_1___get__;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct_2___get__) < 0) __PYX_ERR(0, 1110, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct_2___get__.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct_2___get__ = &__pyx_type_5netif___pyx_scope_struct_2___get__;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct_3_routes) < 0) __PYX_ERR(0, 1688, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct_3_routes.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct_3_routes = &__pyx_type_5netif___pyx_scope_struct_3_routes;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 1821, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct_4_genexpr.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct_4_genexpr = &__pyx_type_5netif___pyx_scope_struct_4_genexpr;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 1822, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct_5_genexpr.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct_5_genexpr = &__pyx_type_5netif___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_5netif___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 1823, __pyx_L1_error)
  __pyx_type_5netif___pyx_scope_struct_6_genexpr.tp_print = 0;
  __pyx_ptype_5netif___pyx_scope_struct_6_genexpr = &__pyx_type_5netif___pyx_scope_struct_6_genexpr;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "netif.pyx":29
 * 
 * 
 * import array             # <<<<<<<<<<<<<<
 * import os
 * import socket
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_array, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":30
 * 
 * import array
 * import os             # <<<<<<<<<<<<<<
 * import socket
 * import ipaddress
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":31
 * import array
 * import os
 * import socket             # <<<<<<<<<<<<<<
 * import ipaddress
 * import enum
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":32
 * import os
 * import socket
 * import ipaddress             # <<<<<<<<<<<<<<
 * import enum
 * import cython
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ipaddress, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipaddress, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":33
 * import socket
 * import ipaddress
 * import enum             # <<<<<<<<<<<<<<
 * import cython
 * from bsd import sysctl
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":35
 * import enum
 * import cython
 * from bsd import sysctl             # <<<<<<<<<<<<<<
 * cimport defs
 * from libc.errno cimport *
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_sysctl);
  __Pyx_GIVEREF(__pyx_n_s_sysctl);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_sysctl);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_bsd, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sysctl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sysctl, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":43
 * 
 * 
 * CLONED_PREFIXES = ['lo', 'tun', 'tap', 'bridge', 'epair', 'carp', 'vlan']             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_lo);
  __Pyx_GIVEREF(__pyx_n_s_lo);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_lo);
  __Pyx_INCREF(__pyx_n_s_tun);
  __Pyx_GIVEREF(__pyx_n_s_tun);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_tun);
  __Pyx_INCREF(__pyx_n_s_tap);
  __Pyx_GIVEREF(__pyx_n_s_tap);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_tap);
  __Pyx_INCREF(__pyx_n_s_bridge);
  __Pyx_GIVEREF(__pyx_n_s_bridge);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_bridge);
  __Pyx_INCREF(__pyx_n_s_epair);
  __Pyx_GIVEREF(__pyx_n_s_epair);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_epair);
  __Pyx_INCREF(__pyx_n_s_carp);
  __Pyx_GIVEREF(__pyx_n_s_carp);
  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_carp);
  __Pyx_INCREF(__pyx_n_s_vlan);
  __Pyx_GIVEREF(__pyx_n_s_vlan);
  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_vlan);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLONED_PREFIXES, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":57
 * 
 * 
 * class AddressFamily(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     UNIX = defs.AF_UNIX
 *     INET = defs.AF_INET
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_AddressFamily, __pyx_n_s_AddressFamily, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":58
 * 
 * class AddressFamily(enum.IntEnum):
 *     UNIX = defs.AF_UNIX             # <<<<<<<<<<<<<<
 *     INET = defs.AF_INET
 *     IMPLINK = defs.AF_IMPLINK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_UNIX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_UNIX, __pyx_t_4) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":59
 * class AddressFamily(enum.IntEnum):
 *     UNIX = defs.AF_UNIX
 *     INET = defs.AF_INET             # <<<<<<<<<<<<<<
 *     IMPLINK = defs.AF_IMPLINK
 *     PUP = defs.AF_PUP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INET, __pyx_t_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":60
 *     UNIX = defs.AF_UNIX
 *     INET = defs.AF_INET
 *     IMPLINK = defs.AF_IMPLINK             # <<<<<<<<<<<<<<
 *     PUP = defs.AF_PUP
 *     CHAOS = defs.AF_CHAOS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_IMPLINK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IMPLINK, __pyx_t_4) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":61
 *     INET = defs.AF_INET
 *     IMPLINK = defs.AF_IMPLINK
 *     PUP = defs.AF_PUP             # <<<<<<<<<<<<<<
 *     CHAOS = defs.AF_CHAOS
 *     NETBIOS = defs.AF_NETBIOS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_PUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PUP, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":62
 *     IMPLINK = defs.AF_IMPLINK
 *     PUP = defs.AF_PUP
 *     CHAOS = defs.AF_CHAOS             # <<<<<<<<<<<<<<
 *     NETBIOS = defs.AF_NETBIOS
 *     ISO = defs.AF_ISO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_CHAOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CHAOS, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":63
 *     PUP = defs.AF_PUP
 *     CHAOS = defs.AF_CHAOS
 *     NETBIOS = defs.AF_NETBIOS             # <<<<<<<<<<<<<<
 *     ISO = defs.AF_ISO
 *     OSI = defs.AF_OSI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_NETBIOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NETBIOS, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":64
 *     CHAOS = defs.AF_CHAOS
 *     NETBIOS = defs.AF_NETBIOS
 *     ISO = defs.AF_ISO             # <<<<<<<<<<<<<<
 *     OSI = defs.AF_OSI
 *     ECMA = defs.AF_ECMA
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ISO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":65
 *     NETBIOS = defs.AF_NETBIOS
 *     ISO = defs.AF_ISO
 *     OSI = defs.AF_OSI             # <<<<<<<<<<<<<<
 *     ECMA = defs.AF_ECMA
 *     DATAKIT = defs.AF_DATAKIT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_OSI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_OSI, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":66
 *     ISO = defs.AF_ISO
 *     OSI = defs.AF_OSI
 *     ECMA = defs.AF_ECMA             # <<<<<<<<<<<<<<
 *     DATAKIT = defs.AF_DATAKIT
 *     CCITT = defs.AF_CCITT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ECMA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ECMA, __pyx_t_4) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":67
 *     OSI = defs.AF_OSI
 *     ECMA = defs.AF_ECMA
 *     DATAKIT = defs.AF_DATAKIT             # <<<<<<<<<<<<<<
 *     CCITT = defs.AF_CCITT
 *     SNA = defs.AF_SNA
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_DATAKIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DATAKIT, __pyx_t_4) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":68
 *     ECMA = defs.AF_ECMA
 *     DATAKIT = defs.AF_DATAKIT
 *     CCITT = defs.AF_CCITT             # <<<<<<<<<<<<<<
 *     SNA = defs.AF_SNA
 *     DECnet = defs.AF_DECnet
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_CCITT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CCITT, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":69
 *     DATAKIT = defs.AF_DATAKIT
 *     CCITT = defs.AF_CCITT
 *     SNA = defs.AF_SNA             # <<<<<<<<<<<<<<
 *     DECnet = defs.AF_DECnet
 *     DLI = defs.AF_DLI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_SNA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SNA, __pyx_t_4) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":70
 *     CCITT = defs.AF_CCITT
 *     SNA = defs.AF_SNA
 *     DECnet = defs.AF_DECnet             # <<<<<<<<<<<<<<
 *     DLI = defs.AF_DLI
 *     LAT = defs.AF_LAT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_DECnet); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DECnet, __pyx_t_4) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":71
 *     SNA = defs.AF_SNA
 *     DECnet = defs.AF_DECnet
 *     DLI = defs.AF_DLI             # <<<<<<<<<<<<<<
 *     LAT = defs.AF_LAT
 *     HYLINK = defs.AF_HYLINK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_DLI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DLI, __pyx_t_4) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":72
 *     DECnet = defs.AF_DECnet
 *     DLI = defs.AF_DLI
 *     LAT = defs.AF_LAT             # <<<<<<<<<<<<<<
 *     HYLINK = defs.AF_HYLINK
 *     APPLETALK = defs.AF_APPLETALK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_LAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LAT, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":73
 *     DLI = defs.AF_DLI
 *     LAT = defs.AF_LAT
 *     HYLINK = defs.AF_HYLINK             # <<<<<<<<<<<<<<
 *     APPLETALK = defs.AF_APPLETALK
 *     ROUTE = defs.AF_ROUTE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_HYLINK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HYLINK, __pyx_t_4) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":74
 *     LAT = defs.AF_LAT
 *     HYLINK = defs.AF_HYLINK
 *     APPLETALK = defs.AF_APPLETALK             # <<<<<<<<<<<<<<
 *     ROUTE = defs.AF_ROUTE
 *     LINK = defs.AF_LINK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_APPLETALK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_APPLETALK, __pyx_t_4) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":75
 *     HYLINK = defs.AF_HYLINK
 *     APPLETALK = defs.AF_APPLETALK
 *     ROUTE = defs.AF_ROUTE             # <<<<<<<<<<<<<<
 *     LINK = defs.AF_LINK
 *     COIP = defs.AF_COIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ROUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ROUTE, __pyx_t_4) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":76
 *     APPLETALK = defs.AF_APPLETALK
 *     ROUTE = defs.AF_ROUTE
 *     LINK = defs.AF_LINK             # <<<<<<<<<<<<<<
 *     COIP = defs.AF_COIP
 *     CNT = defs.AF_CNT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_LINK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK, __pyx_t_4) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":77
 *     ROUTE = defs.AF_ROUTE
 *     LINK = defs.AF_LINK
 *     COIP = defs.AF_COIP             # <<<<<<<<<<<<<<
 *     CNT = defs.AF_CNT
 *     IPX = defs.AF_IPX
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_COIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_COIP, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":78
 *     LINK = defs.AF_LINK
 *     COIP = defs.AF_COIP
 *     CNT = defs.AF_CNT             # <<<<<<<<<<<<<<
 *     IPX = defs.AF_IPX
 *     SIP = defs.AF_SIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_CNT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CNT, __pyx_t_4) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":79
 *     COIP = defs.AF_COIP
 *     CNT = defs.AF_CNT
 *     IPX = defs.AF_IPX             # <<<<<<<<<<<<<<
 *     SIP = defs.AF_SIP
 *     ISDN = defs.AF_ISDN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_IPX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IPX, __pyx_t_4) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":80
 *     CNT = defs.AF_CNT
 *     IPX = defs.AF_IPX
 *     SIP = defs.AF_SIP             # <<<<<<<<<<<<<<
 *     ISDN = defs.AF_ISDN
 *     E164 = defs.AF_E164
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_SIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SIP, __pyx_t_4) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":81
 *     IPX = defs.AF_IPX
 *     SIP = defs.AF_SIP
 *     ISDN = defs.AF_ISDN             # <<<<<<<<<<<<<<
 *     E164 = defs.AF_E164
 *     INET6 = defs.AF_INET6
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ISDN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISDN, __pyx_t_4) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":82
 *     SIP = defs.AF_SIP
 *     ISDN = defs.AF_ISDN
 *     E164 = defs.AF_E164             # <<<<<<<<<<<<<<
 *     INET6 = defs.AF_INET6
 *     NATM = defs.AF_NATM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_E164); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_E164, __pyx_t_4) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":83
 *     ISDN = defs.AF_ISDN
 *     E164 = defs.AF_E164
 *     INET6 = defs.AF_INET6             # <<<<<<<<<<<<<<
 *     NATM = defs.AF_NATM
 *     ATM = defs.AF_ATM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_INET6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INET6, __pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":84
 *     E164 = defs.AF_E164
 *     INET6 = defs.AF_INET6
 *     NATM = defs.AF_NATM             # <<<<<<<<<<<<<<
 *     ATM = defs.AF_ATM
 *     NETGRAPH = defs.AF_NETGRAPH
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_NATM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NATM, __pyx_t_4) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":85
 *     INET6 = defs.AF_INET6
 *     NATM = defs.AF_NATM
 *     ATM = defs.AF_ATM             # <<<<<<<<<<<<<<
 *     NETGRAPH = defs.AF_NETGRAPH
 *     SLOW = defs.AF_SLOW
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ATM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATM, __pyx_t_4) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":86
 *     NATM = defs.AF_NATM
 *     ATM = defs.AF_ATM
 *     NETGRAPH = defs.AF_NETGRAPH             # <<<<<<<<<<<<<<
 *     SLOW = defs.AF_SLOW
 *     SCLUSTER = defs.AF_SCLUSTER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_NETGRAPH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NETGRAPH, __pyx_t_4) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":87
 *     ATM = defs.AF_ATM
 *     NETGRAPH = defs.AF_NETGRAPH
 *     SLOW = defs.AF_SLOW             # <<<<<<<<<<<<<<
 *     SCLUSTER = defs.AF_SCLUSTER
 *     ARP = defs.AF_ARP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_SLOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SLOW, __pyx_t_4) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":88
 *     NETGRAPH = defs.AF_NETGRAPH
 *     SLOW = defs.AF_SLOW
 *     SCLUSTER = defs.AF_SCLUSTER             # <<<<<<<<<<<<<<
 *     ARP = defs.AF_ARP
 *     BLUETOOTH = defs.AF_BLUETOOTH
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_SCLUSTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SCLUSTER, __pyx_t_4) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":89
 *     SLOW = defs.AF_SLOW
 *     SCLUSTER = defs.AF_SCLUSTER
 *     ARP = defs.AF_ARP             # <<<<<<<<<<<<<<
 *     BLUETOOTH = defs.AF_BLUETOOTH
 *     IEEE80211 = defs.AF_IEEE80211
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_ARP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ARP, __pyx_t_4) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":90
 *     SCLUSTER = defs.AF_SCLUSTER
 *     ARP = defs.AF_ARP
 *     BLUETOOTH = defs.AF_BLUETOOTH             # <<<<<<<<<<<<<<
 *     IEEE80211 = defs.AF_IEEE80211
 *     INET_SDP = defs.AF_INET_SDP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_BLUETOOTH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BLUETOOTH, __pyx_t_4) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":91
 *     ARP = defs.AF_ARP
 *     BLUETOOTH = defs.AF_BLUETOOTH
 *     IEEE80211 = defs.AF_IEEE80211             # <<<<<<<<<<<<<<
 *     INET_SDP = defs.AF_INET_SDP
 *     INET6_SDP = defs.AF_INET6_SDP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_IEEE80211); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IEEE80211, __pyx_t_4) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":92
 *     BLUETOOTH = defs.AF_BLUETOOTH
 *     IEEE80211 = defs.AF_IEEE80211
 *     INET_SDP = defs.AF_INET_SDP             # <<<<<<<<<<<<<<
 *     INET6_SDP = defs.AF_INET6_SDP
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_INET_SDP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INET_SDP, __pyx_t_4) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":93
 *     IEEE80211 = defs.AF_IEEE80211
 *     INET_SDP = defs.AF_INET_SDP
 *     INET6_SDP = defs.AF_INET6_SDP             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(AF_INET6_SDP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INET6_SDP, __pyx_t_4) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":57
 * 
 * 
 * class AddressFamily(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     UNIX = defs.AF_UNIX
 *     INET = defs.AF_INET
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_AddressFamily, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AddressFamily, __pyx_t_4) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":96
 * 
 * 
 * class RouteFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     UP = defs.RTF_UP
 *     GATEWAY = defs.RTF_GATEWAY
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_RouteFlags, __pyx_n_s_RouteFlags, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":97
 * 
 * class RouteFlags(enum.IntEnum):
 *     UP = defs.RTF_UP             # <<<<<<<<<<<<<<
 *     GATEWAY = defs.RTF_GATEWAY
 *     HOST = defs.RTF_HOST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_UP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_UP, __pyx_t_4) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":98
 * class RouteFlags(enum.IntEnum):
 *     UP = defs.RTF_UP
 *     GATEWAY = defs.RTF_GATEWAY             # <<<<<<<<<<<<<<
 *     HOST = defs.RTF_HOST
 *     REJECT = defs.RTF_REJECT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_GATEWAY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_GATEWAY, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":99
 *     UP = defs.RTF_UP
 *     GATEWAY = defs.RTF_GATEWAY
 *     HOST = defs.RTF_HOST             # <<<<<<<<<<<<<<
 *     REJECT = defs.RTF_REJECT
 *     DYNAMIC = defs.RTF_DYNAMIC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_HOST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HOST, __pyx_t_4) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":100
 *     GATEWAY = defs.RTF_GATEWAY
 *     HOST = defs.RTF_HOST
 *     REJECT = defs.RTF_REJECT             # <<<<<<<<<<<<<<
 *     DYNAMIC = defs.RTF_DYNAMIC
 *     MODIFIED = defs.RTF_MODIFIED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_REJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_REJECT, __pyx_t_4) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":101
 *     HOST = defs.RTF_HOST
 *     REJECT = defs.RTF_REJECT
 *     DYNAMIC = defs.RTF_DYNAMIC             # <<<<<<<<<<<<<<
 *     MODIFIED = defs.RTF_MODIFIED
 *     DONE = defs.RTF_DONE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_DYNAMIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DYNAMIC, __pyx_t_4) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":102
 *     REJECT = defs.RTF_REJECT
 *     DYNAMIC = defs.RTF_DYNAMIC
 *     MODIFIED = defs.RTF_MODIFIED             # <<<<<<<<<<<<<<
 *     DONE = defs.RTF_DONE
 *     XRESOLVE = defs.RTF_XRESOLVE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_MODIFIED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MODIFIED, __pyx_t_4) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":103
 *     DYNAMIC = defs.RTF_DYNAMIC
 *     MODIFIED = defs.RTF_MODIFIED
 *     DONE = defs.RTF_DONE             # <<<<<<<<<<<<<<
 *     XRESOLVE = defs.RTF_XRESOLVE
 *     LLINFO = defs.RTF_LLINFO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_DONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DONE, __pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":104
 *     MODIFIED = defs.RTF_MODIFIED
 *     DONE = defs.RTF_DONE
 *     XRESOLVE = defs.RTF_XRESOLVE             # <<<<<<<<<<<<<<
 *     LLINFO = defs.RTF_LLINFO
 *     LLDATA = defs.RTF_LLDATA
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_XRESOLVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_XRESOLVE, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":105
 *     DONE = defs.RTF_DONE
 *     XRESOLVE = defs.RTF_XRESOLVE
 *     LLINFO = defs.RTF_LLINFO             # <<<<<<<<<<<<<<
 *     LLDATA = defs.RTF_LLDATA
 *     STATIC = defs.RTF_STATIC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_LLINFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LLINFO, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":106
 *     XRESOLVE = defs.RTF_XRESOLVE
 *     LLINFO = defs.RTF_LLINFO
 *     LLDATA = defs.RTF_LLDATA             # <<<<<<<<<<<<<<
 *     STATIC = defs.RTF_STATIC
 *     BLACKHOLE = defs.RTF_BLACKHOLE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_LLDATA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LLDATA, __pyx_t_4) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":107
 *     LLINFO = defs.RTF_LLINFO
 *     LLDATA = defs.RTF_LLDATA
 *     STATIC = defs.RTF_STATIC             # <<<<<<<<<<<<<<
 *     BLACKHOLE = defs.RTF_BLACKHOLE
 *     PROTO1 = defs.RTF_PROTO1
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_STATIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STATIC, __pyx_t_4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":108
 *     LLDATA = defs.RTF_LLDATA
 *     STATIC = defs.RTF_STATIC
 *     BLACKHOLE = defs.RTF_BLACKHOLE             # <<<<<<<<<<<<<<
 *     PROTO1 = defs.RTF_PROTO1
 *     PROTO2 = defs.RTF_PROTO2
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_BLACKHOLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BLACKHOLE, __pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":109
 *     STATIC = defs.RTF_STATIC
 *     BLACKHOLE = defs.RTF_BLACKHOLE
 *     PROTO1 = defs.RTF_PROTO1             # <<<<<<<<<<<<<<
 *     PROTO2 = defs.RTF_PROTO2
 *     PROTO3 = defs.RTF_PROTO3
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_PROTO1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROTO1, __pyx_t_4) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":110
 *     BLACKHOLE = defs.RTF_BLACKHOLE
 *     PROTO1 = defs.RTF_PROTO1
 *     PROTO2 = defs.RTF_PROTO2             # <<<<<<<<<<<<<<
 *     PROTO3 = defs.RTF_PROTO3
 *     PINNED = defs.RTF_PINNED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_PROTO2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROTO2, __pyx_t_4) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":111
 *     PROTO1 = defs.RTF_PROTO1
 *     PROTO2 = defs.RTF_PROTO2
 *     PROTO3 = defs.RTF_PROTO3             # <<<<<<<<<<<<<<
 *     PINNED = defs.RTF_PINNED
 *     LOCAL = defs.RTF_LOCAL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_PROTO3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROTO3, __pyx_t_4) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":112
 *     PROTO2 = defs.RTF_PROTO2
 *     PROTO3 = defs.RTF_PROTO3
 *     PINNED = defs.RTF_PINNED             # <<<<<<<<<<<<<<
 *     LOCAL = defs.RTF_LOCAL
 *     BROADCAST = defs.RTF_BROADCAST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_PINNED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PINNED, __pyx_t_4) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":113
 *     PROTO3 = defs.RTF_PROTO3
 *     PINNED = defs.RTF_PINNED
 *     LOCAL = defs.RTF_LOCAL             # <<<<<<<<<<<<<<
 *     BROADCAST = defs.RTF_BROADCAST
 *     MULTICAST = defs.RTF_MULTICAST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_LOCAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":114
 *     PINNED = defs.RTF_PINNED
 *     LOCAL = defs.RTF_LOCAL
 *     BROADCAST = defs.RTF_BROADCAST             # <<<<<<<<<<<<<<
 *     MULTICAST = defs.RTF_MULTICAST
 *     STICKY = defs.RTF_STICKY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_BROADCAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BROADCAST, __pyx_t_4) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":115
 *     LOCAL = defs.RTF_LOCAL
 *     BROADCAST = defs.RTF_BROADCAST
 *     MULTICAST = defs.RTF_MULTICAST             # <<<<<<<<<<<<<<
 *     STICKY = defs.RTF_STICKY
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_MULTICAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MULTICAST, __pyx_t_4) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":116
 *     BROADCAST = defs.RTF_BROADCAST
 *     MULTICAST = defs.RTF_MULTICAST
 *     STICKY = defs.RTF_STICKY             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTF_STICKY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STICKY, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":96
 * 
 * 
 * class RouteFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     UP = defs.RTF_UP
 *     GATEWAY = defs.RTF_GATEWAY
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_RouteFlags, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RouteFlags, __pyx_t_4) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":119
 * 
 * 
 * class RoutingMessageType(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     INVALID = 0
 *     ADD = defs.RTM_ADD
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_RoutingMessageType, __pyx_n_s_RoutingMessageType, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":120
 * 
 * class RoutingMessageType(enum.IntEnum):
 *     INVALID = 0             # <<<<<<<<<<<<<<
 *     ADD = defs.RTM_ADD
 *     DELETE = defs.RTM_DELETE
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INVALID, __pyx_int_0) < 0) __PYX_ERR(0, 120, __pyx_L1_error)

  /* "netif.pyx":121
 * class RoutingMessageType(enum.IntEnum):
 *     INVALID = 0
 *     ADD = defs.RTM_ADD             # <<<<<<<<<<<<<<
 *     DELETE = defs.RTM_DELETE
 *     CHANGE = defs.RTM_CHANGE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_ADD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ADD, __pyx_t_4) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":122
 *     INVALID = 0
 *     ADD = defs.RTM_ADD
 *     DELETE = defs.RTM_DELETE             # <<<<<<<<<<<<<<
 *     CHANGE = defs.RTM_CHANGE
 *     GET = defs.RTM_GET
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_DELETE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DELETE, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":123
 *     ADD = defs.RTM_ADD
 *     DELETE = defs.RTM_DELETE
 *     CHANGE = defs.RTM_CHANGE             # <<<<<<<<<<<<<<
 *     GET = defs.RTM_GET
 *     LOSING = defs.RTM_LOSING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_CHANGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CHANGE, __pyx_t_4) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":124
 *     DELETE = defs.RTM_DELETE
 *     CHANGE = defs.RTM_CHANGE
 *     GET = defs.RTM_GET             # <<<<<<<<<<<<<<
 *     LOSING = defs.RTM_LOSING
 *     REDIRECT = defs.RTM_REDIRECT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_GET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_GET, __pyx_t_4) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":125
 *     CHANGE = defs.RTM_CHANGE
 *     GET = defs.RTM_GET
 *     LOSING = defs.RTM_LOSING             # <<<<<<<<<<<<<<
 *     REDIRECT = defs.RTM_REDIRECT
 *     MISS = defs.RTM_MISS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_LOSING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOSING, __pyx_t_4) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":126
 *     GET = defs.RTM_GET
 *     LOSING = defs.RTM_LOSING
 *     REDIRECT = defs.RTM_REDIRECT             # <<<<<<<<<<<<<<
 *     MISS = defs.RTM_MISS
 *     LOCK = defs.RTM_LOCK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_REDIRECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_REDIRECT, __pyx_t_4) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":127
 *     LOSING = defs.RTM_LOSING
 *     REDIRECT = defs.RTM_REDIRECT
 *     MISS = defs.RTM_MISS             # <<<<<<<<<<<<<<
 *     LOCK = defs.RTM_LOCK
 *     RESOLVE = defs.RTM_RESOLVE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_MISS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MISS, __pyx_t_4) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":128
 *     REDIRECT = defs.RTM_REDIRECT
 *     MISS = defs.RTM_MISS
 *     LOCK = defs.RTM_LOCK             # <<<<<<<<<<<<<<
 *     RESOLVE = defs.RTM_RESOLVE
 *     NEWADDR = defs.RTM_NEWADDR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_LOCK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOCK, __pyx_t_4) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":129
 *     MISS = defs.RTM_MISS
 *     LOCK = defs.RTM_LOCK
 *     RESOLVE = defs.RTM_RESOLVE             # <<<<<<<<<<<<<<
 *     NEWADDR = defs.RTM_NEWADDR
 *     DELADDR = defs.RTM_DELADDR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_RESOLVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RESOLVE, __pyx_t_4) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":130
 *     LOCK = defs.RTM_LOCK
 *     RESOLVE = defs.RTM_RESOLVE
 *     NEWADDR = defs.RTM_NEWADDR             # <<<<<<<<<<<<<<
 *     DELADDR = defs.RTM_DELADDR
 *     IFINFO = defs.RTM_IFINFO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_NEWADDR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NEWADDR, __pyx_t_4) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":131
 *     RESOLVE = defs.RTM_RESOLVE
 *     NEWADDR = defs.RTM_NEWADDR
 *     DELADDR = defs.RTM_DELADDR             # <<<<<<<<<<<<<<
 *     IFINFO = defs.RTM_IFINFO
 *     NEWMADDR = defs.RTM_NEWMADDR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_DELADDR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DELADDR, __pyx_t_4) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":132
 *     NEWADDR = defs.RTM_NEWADDR
 *     DELADDR = defs.RTM_DELADDR
 *     IFINFO = defs.RTM_IFINFO             # <<<<<<<<<<<<<<
 *     NEWMADDR = defs.RTM_NEWMADDR
 *     DELMADDR = defs.RTM_DELMADDR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_IFINFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IFINFO, __pyx_t_4) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":133
 *     DELADDR = defs.RTM_DELADDR
 *     IFINFO = defs.RTM_IFINFO
 *     NEWMADDR = defs.RTM_NEWMADDR             # <<<<<<<<<<<<<<
 *     DELMADDR = defs.RTM_DELMADDR
 *     IFANNOUNCE = defs.RTM_IFANNOUNCE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_NEWMADDR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NEWMADDR, __pyx_t_4) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":134
 *     IFINFO = defs.RTM_IFINFO
 *     NEWMADDR = defs.RTM_NEWMADDR
 *     DELMADDR = defs.RTM_DELMADDR             # <<<<<<<<<<<<<<
 *     IFANNOUNCE = defs.RTM_IFANNOUNCE
 *     IEEE80211 = defs.RTM_IEEE80211
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_DELMADDR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DELMADDR, __pyx_t_4) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":135
 *     NEWMADDR = defs.RTM_NEWMADDR
 *     DELMADDR = defs.RTM_DELMADDR
 *     IFANNOUNCE = defs.RTM_IFANNOUNCE             # <<<<<<<<<<<<<<
 *     IEEE80211 = defs.RTM_IEEE80211
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_IFANNOUNCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IFANNOUNCE, __pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":136
 *     DELMADDR = defs.RTM_DELMADDR
 *     IFANNOUNCE = defs.RTM_IFANNOUNCE
 *     IEEE80211 = defs.RTM_IEEE80211             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(RTM_IEEE80211); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IEEE80211, __pyx_t_4) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":119
 * 
 * 
 * class RoutingMessageType(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     INVALID = 0
 *     ADD = defs.RTM_ADD
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_RoutingMessageType, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RoutingMessageType, __pyx_t_4) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":139
 * 
 * 
 * class InterfaceFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     UP = defs.IFF_UP
 *     BROADCAST = defs.IFF_BROADCAST
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceFlags, __pyx_n_s_InterfaceFlags, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":140
 * 
 * class InterfaceFlags(enum.IntEnum):
 *     UP = defs.IFF_UP             # <<<<<<<<<<<<<<
 *     BROADCAST = defs.IFF_BROADCAST
 *     DEBUG = defs.IFF_DEBUG
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_UP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_UP, __pyx_t_4) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":141
 * class InterfaceFlags(enum.IntEnum):
 *     UP = defs.IFF_UP
 *     BROADCAST = defs.IFF_BROADCAST             # <<<<<<<<<<<<<<
 *     DEBUG = defs.IFF_DEBUG
 *     LOOPBACK = defs.IFF_LOOPBACK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_BROADCAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BROADCAST, __pyx_t_4) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":142
 *     UP = defs.IFF_UP
 *     BROADCAST = defs.IFF_BROADCAST
 *     DEBUG = defs.IFF_DEBUG             # <<<<<<<<<<<<<<
 *     LOOPBACK = defs.IFF_LOOPBACK
 *     POINTOPOINT = defs.IFF_POINTOPOINT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_DEBUG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DEBUG, __pyx_t_4) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":143
 *     BROADCAST = defs.IFF_BROADCAST
 *     DEBUG = defs.IFF_DEBUG
 *     LOOPBACK = defs.IFF_LOOPBACK             # <<<<<<<<<<<<<<
 *     POINTOPOINT = defs.IFF_POINTOPOINT
 *     DRV_RUNNING = defs.IFF_DRV_RUNNING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_LOOPBACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOOPBACK, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":144
 *     DEBUG = defs.IFF_DEBUG
 *     LOOPBACK = defs.IFF_LOOPBACK
 *     POINTOPOINT = defs.IFF_POINTOPOINT             # <<<<<<<<<<<<<<
 *     DRV_RUNNING = defs.IFF_DRV_RUNNING
 *     NOARP = defs.IFF_NOARP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_POINTOPOINT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_POINTOPOINT, __pyx_t_4) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":145
 *     LOOPBACK = defs.IFF_LOOPBACK
 *     POINTOPOINT = defs.IFF_POINTOPOINT
 *     DRV_RUNNING = defs.IFF_DRV_RUNNING             # <<<<<<<<<<<<<<
 *     NOARP = defs.IFF_NOARP
 *     PROMISC = defs.IFF_PROMISC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_DRV_RUNNING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DRV_RUNNING, __pyx_t_4) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":146
 *     POINTOPOINT = defs.IFF_POINTOPOINT
 *     DRV_RUNNING = defs.IFF_DRV_RUNNING
 *     NOARP = defs.IFF_NOARP             # <<<<<<<<<<<<<<
 *     PROMISC = defs.IFF_PROMISC
 *     ALLMULTI = defs.IFF_ALLMULTI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_NOARP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NOARP, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":147
 *     DRV_RUNNING = defs.IFF_DRV_RUNNING
 *     NOARP = defs.IFF_NOARP
 *     PROMISC = defs.IFF_PROMISC             # <<<<<<<<<<<<<<
 *     ALLMULTI = defs.IFF_ALLMULTI
 *     DRV_OACTIVE = defs.IFF_DRV_OACTIVE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_PROMISC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROMISC, __pyx_t_4) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":148
 *     NOARP = defs.IFF_NOARP
 *     PROMISC = defs.IFF_PROMISC
 *     ALLMULTI = defs.IFF_ALLMULTI             # <<<<<<<<<<<<<<
 *     DRV_OACTIVE = defs.IFF_DRV_OACTIVE
 *     SIMPLEX = defs.IFF_SIMPLEX
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_ALLMULTI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ALLMULTI, __pyx_t_4) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":149
 *     PROMISC = defs.IFF_PROMISC
 *     ALLMULTI = defs.IFF_ALLMULTI
 *     DRV_OACTIVE = defs.IFF_DRV_OACTIVE             # <<<<<<<<<<<<<<
 *     SIMPLEX = defs.IFF_SIMPLEX
 *     LINK0 = defs.IFF_LINK0
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_DRV_OACTIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DRV_OACTIVE, __pyx_t_4) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":150
 *     ALLMULTI = defs.IFF_ALLMULTI
 *     DRV_OACTIVE = defs.IFF_DRV_OACTIVE
 *     SIMPLEX = defs.IFF_SIMPLEX             # <<<<<<<<<<<<<<
 *     LINK0 = defs.IFF_LINK0
 *     LINK1 = defs.IFF_LINK1
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_SIMPLEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SIMPLEX, __pyx_t_4) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":151
 *     DRV_OACTIVE = defs.IFF_DRV_OACTIVE
 *     SIMPLEX = defs.IFF_SIMPLEX
 *     LINK0 = defs.IFF_LINK0             # <<<<<<<<<<<<<<
 *     LINK1 = defs.IFF_LINK1
 *     LINK2 = defs.IFF_LINK2
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_LINK0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK0, __pyx_t_4) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":152
 *     SIMPLEX = defs.IFF_SIMPLEX
 *     LINK0 = defs.IFF_LINK0
 *     LINK1 = defs.IFF_LINK1             # <<<<<<<<<<<<<<
 *     LINK2 = defs.IFF_LINK2
 *     MULTICAST = defs.IFF_MULTICAST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_LINK1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK1, __pyx_t_4) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":153
 *     LINK0 = defs.IFF_LINK0
 *     LINK1 = defs.IFF_LINK1
 *     LINK2 = defs.IFF_LINK2             # <<<<<<<<<<<<<<
 *     MULTICAST = defs.IFF_MULTICAST
 *     CANTCONFIG = defs.IFF_CANTCONFIG
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_LINK2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK2, __pyx_t_4) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":154
 *     LINK1 = defs.IFF_LINK1
 *     LINK2 = defs.IFF_LINK2
 *     MULTICAST = defs.IFF_MULTICAST             # <<<<<<<<<<<<<<
 *     CANTCONFIG = defs.IFF_CANTCONFIG
 *     PPROMISC = defs.IFF_PPROMISC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_MULTICAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MULTICAST, __pyx_t_4) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":155
 *     LINK2 = defs.IFF_LINK2
 *     MULTICAST = defs.IFF_MULTICAST
 *     CANTCONFIG = defs.IFF_CANTCONFIG             # <<<<<<<<<<<<<<
 *     PPROMISC = defs.IFF_PPROMISC
 *     MONITOR = defs.IFF_MONITOR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_CANTCONFIG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CANTCONFIG, __pyx_t_4) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":156
 *     MULTICAST = defs.IFF_MULTICAST
 *     CANTCONFIG = defs.IFF_CANTCONFIG
 *     PPROMISC = defs.IFF_PPROMISC             # <<<<<<<<<<<<<<
 *     MONITOR = defs.IFF_MONITOR
 *     STATICARP = defs.IFF_STATICARP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_PPROMISC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PPROMISC, __pyx_t_4) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":157
 *     CANTCONFIG = defs.IFF_CANTCONFIG
 *     PPROMISC = defs.IFF_PPROMISC
 *     MONITOR = defs.IFF_MONITOR             # <<<<<<<<<<<<<<
 *     STATICARP = defs.IFF_STATICARP
 *     DYING = defs.IFF_DYING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_MONITOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MONITOR, __pyx_t_4) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":158
 *     PPROMISC = defs.IFF_PPROMISC
 *     MONITOR = defs.IFF_MONITOR
 *     STATICARP = defs.IFF_STATICARP             # <<<<<<<<<<<<<<
 *     DYING = defs.IFF_DYING
 *     RENAMING = defs.IFF_RENAMING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_STATICARP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STATICARP, __pyx_t_4) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":159
 *     MONITOR = defs.IFF_MONITOR
 *     STATICARP = defs.IFF_STATICARP
 *     DYING = defs.IFF_DYING             # <<<<<<<<<<<<<<
 *     RENAMING = defs.IFF_RENAMING
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_DYING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DYING, __pyx_t_4) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":160
 *     STATICARP = defs.IFF_STATICARP
 *     DYING = defs.IFF_DYING
 *     RENAMING = defs.IFF_RENAMING             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFF_RENAMING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RENAMING, __pyx_t_4) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":139
 * 
 * 
 * class InterfaceFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     UP = defs.IFF_UP
 *     BROADCAST = defs.IFF_BROADCAST
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceFlags, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceFlags, __pyx_t_4) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":163
 * 
 * 
 * class InterfaceType(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     OTHER = defs.IFT_OTHER
 *     I1822 = defs.IFT_1822
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceType, __pyx_n_s_InterfaceType, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":164
 * 
 * class InterfaceType(enum.IntEnum):
 *     OTHER = defs.IFT_OTHER             # <<<<<<<<<<<<<<
 *     I1822 = defs.IFT_1822
 *     HDH1822 = defs.IFT_HDH1822
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_OTHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_OTHER, __pyx_t_4) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":165
 * class InterfaceType(enum.IntEnum):
 *     OTHER = defs.IFT_OTHER
 *     I1822 = defs.IFT_1822             # <<<<<<<<<<<<<<
 *     HDH1822 = defs.IFT_HDH1822
 *     X25DDN = defs.IFT_X25DDN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_1822); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_I1822, __pyx_t_4) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":166
 *     OTHER = defs.IFT_OTHER
 *     I1822 = defs.IFT_1822
 *     HDH1822 = defs.IFT_HDH1822             # <<<<<<<<<<<<<<
 *     X25DDN = defs.IFT_X25DDN
 *     X25 = defs.IFT_X25
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HDH1822); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HDH1822, __pyx_t_4) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":167
 *     I1822 = defs.IFT_1822
 *     HDH1822 = defs.IFT_HDH1822
 *     X25DDN = defs.IFT_X25DDN             # <<<<<<<<<<<<<<
 *     X25 = defs.IFT_X25
 *     ETHER = defs.IFT_ETHER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_X25DDN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_X25DDN, __pyx_t_4) < 0) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":168
 *     HDH1822 = defs.IFT_HDH1822
 *     X25DDN = defs.IFT_X25DDN
 *     X25 = defs.IFT_X25             # <<<<<<<<<<<<<<
 *     ETHER = defs.IFT_ETHER
 *     ISO88023 = defs.IFT_ISO88023
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_X25); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_X25, __pyx_t_4) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":169
 *     X25DDN = defs.IFT_X25DDN
 *     X25 = defs.IFT_X25
 *     ETHER = defs.IFT_ETHER             # <<<<<<<<<<<<<<
 *     ISO88023 = defs.IFT_ISO88023
 *     ISO88024 = defs.IFT_ISO88024
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ETHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ETHER, __pyx_t_4) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":170
 *     X25 = defs.IFT_X25
 *     ETHER = defs.IFT_ETHER
 *     ISO88023 = defs.IFT_ISO88023             # <<<<<<<<<<<<<<
 *     ISO88024 = defs.IFT_ISO88024
 *     ISO88025 = defs.IFT_ISO88025
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88023); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88023, __pyx_t_4) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":171
 *     ETHER = defs.IFT_ETHER
 *     ISO88023 = defs.IFT_ISO88023
 *     ISO88024 = defs.IFT_ISO88024             # <<<<<<<<<<<<<<
 *     ISO88025 = defs.IFT_ISO88025
 *     ISO88026 = defs.IFT_ISO88026
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88024); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88024, __pyx_t_4) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":172
 *     ISO88023 = defs.IFT_ISO88023
 *     ISO88024 = defs.IFT_ISO88024
 *     ISO88025 = defs.IFT_ISO88025             # <<<<<<<<<<<<<<
 *     ISO88026 = defs.IFT_ISO88026
 *     STARLAN = defs.IFT_STARLAN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88025); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88025, __pyx_t_4) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":173
 *     ISO88024 = defs.IFT_ISO88024
 *     ISO88025 = defs.IFT_ISO88025
 *     ISO88026 = defs.IFT_ISO88026             # <<<<<<<<<<<<<<
 *     STARLAN = defs.IFT_STARLAN
 *     P10 = defs.IFT_P10
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88026); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88026, __pyx_t_4) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":174
 *     ISO88025 = defs.IFT_ISO88025
 *     ISO88026 = defs.IFT_ISO88026
 *     STARLAN = defs.IFT_STARLAN             # <<<<<<<<<<<<<<
 *     P10 = defs.IFT_P10
 *     P80 = defs.IFT_P80
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_STARLAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STARLAN, __pyx_t_4) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":175
 *     ISO88026 = defs.IFT_ISO88026
 *     STARLAN = defs.IFT_STARLAN
 *     P10 = defs.IFT_P10             # <<<<<<<<<<<<<<
 *     P80 = defs.IFT_P80
 *     HY = defs.IFT_HY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_P10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_P10, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":176
 *     STARLAN = defs.IFT_STARLAN
 *     P10 = defs.IFT_P10
 *     P80 = defs.IFT_P80             # <<<<<<<<<<<<<<
 *     HY = defs.IFT_HY
 *     FDDI = defs.IFT_FDDI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_P80); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_P80, __pyx_t_4) < 0) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":177
 *     P10 = defs.IFT_P10
 *     P80 = defs.IFT_P80
 *     HY = defs.IFT_HY             # <<<<<<<<<<<<<<
 *     FDDI = defs.IFT_FDDI
 *     LAPB = defs.IFT_LAPB
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HY, __pyx_t_4) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":178
 *     P80 = defs.IFT_P80
 *     HY = defs.IFT_HY
 *     FDDI = defs.IFT_FDDI             # <<<<<<<<<<<<<<
 *     LAPB = defs.IFT_LAPB
 *     SDLC = defs.IFT_SDLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FDDI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FDDI, __pyx_t_4) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":179
 *     HY = defs.IFT_HY
 *     FDDI = defs.IFT_FDDI
 *     LAPB = defs.IFT_LAPB             # <<<<<<<<<<<<<<
 *     SDLC = defs.IFT_SDLC
 *     T1 = defs.IFT_T1
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_LAPB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LAPB, __pyx_t_4) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":180
 *     FDDI = defs.IFT_FDDI
 *     LAPB = defs.IFT_LAPB
 *     SDLC = defs.IFT_SDLC             # <<<<<<<<<<<<<<
 *     T1 = defs.IFT_T1
 *     CEPT = defs.IFT_CEPT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SDLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SDLC, __pyx_t_4) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":181
 *     LAPB = defs.IFT_LAPB
 *     SDLC = defs.IFT_SDLC
 *     T1 = defs.IFT_T1             # <<<<<<<<<<<<<<
 *     CEPT = defs.IFT_CEPT
 *     ISDNBASIC = defs.IFT_ISDNBASIC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_T1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_T1, __pyx_t_4) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":182
 *     SDLC = defs.IFT_SDLC
 *     T1 = defs.IFT_T1
 *     CEPT = defs.IFT_CEPT             # <<<<<<<<<<<<<<
 *     ISDNBASIC = defs.IFT_ISDNBASIC
 *     ISDNPRIMARY = defs.IFT_ISDNPRIMARY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_CEPT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CEPT, __pyx_t_4) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":183
 *     T1 = defs.IFT_T1
 *     CEPT = defs.IFT_CEPT
 *     ISDNBASIC = defs.IFT_ISDNBASIC             # <<<<<<<<<<<<<<
 *     ISDNPRIMARY = defs.IFT_ISDNPRIMARY
 *     PTPSERIAL = defs.IFT_PTPSERIAL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISDNBASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISDNBASIC, __pyx_t_4) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":184
 *     CEPT = defs.IFT_CEPT
 *     ISDNBASIC = defs.IFT_ISDNBASIC
 *     ISDNPRIMARY = defs.IFT_ISDNPRIMARY             # <<<<<<<<<<<<<<
 *     PTPSERIAL = defs.IFT_PTPSERIAL
 *     PPP = defs.IFT_PPP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISDNPRIMARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISDNPRIMARY, __pyx_t_4) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":185
 *     ISDNBASIC = defs.IFT_ISDNBASIC
 *     ISDNPRIMARY = defs.IFT_ISDNPRIMARY
 *     PTPSERIAL = defs.IFT_PTPSERIAL             # <<<<<<<<<<<<<<
 *     PPP = defs.IFT_PPP
 *     LOOP = defs.IFT_LOOP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PTPSERIAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PTPSERIAL, __pyx_t_4) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":186
 *     ISDNPRIMARY = defs.IFT_ISDNPRIMARY
 *     PTPSERIAL = defs.IFT_PTPSERIAL
 *     PPP = defs.IFT_PPP             # <<<<<<<<<<<<<<
 *     LOOP = defs.IFT_LOOP
 *     EON = defs.IFT_EON
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PPP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PPP, __pyx_t_4) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":187
 *     PTPSERIAL = defs.IFT_PTPSERIAL
 *     PPP = defs.IFT_PPP
 *     LOOP = defs.IFT_LOOP             # <<<<<<<<<<<<<<
 *     EON = defs.IFT_EON
 *     XETHER = defs.IFT_XETHER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_LOOP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOOP, __pyx_t_4) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":188
 *     PPP = defs.IFT_PPP
 *     LOOP = defs.IFT_LOOP
 *     EON = defs.IFT_EON             # <<<<<<<<<<<<<<
 *     XETHER = defs.IFT_XETHER
 *     NSIP = defs.IFT_NSIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_EON); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_EON, __pyx_t_4) < 0) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":189
 *     LOOP = defs.IFT_LOOP
 *     EON = defs.IFT_EON
 *     XETHER = defs.IFT_XETHER             # <<<<<<<<<<<<<<
 *     NSIP = defs.IFT_NSIP
 *     SLIP = defs.IFT_SLIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_XETHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_XETHER, __pyx_t_4) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":190
 *     EON = defs.IFT_EON
 *     XETHER = defs.IFT_XETHER
 *     NSIP = defs.IFT_NSIP             # <<<<<<<<<<<<<<
 *     SLIP = defs.IFT_SLIP
 *     ULTRA = defs.IFT_ULTRA
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_NSIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NSIP, __pyx_t_4) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":191
 *     XETHER = defs.IFT_XETHER
 *     NSIP = defs.IFT_NSIP
 *     SLIP = defs.IFT_SLIP             # <<<<<<<<<<<<<<
 *     ULTRA = defs.IFT_ULTRA
 *     DS3 = defs.IFT_DS3
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SLIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SLIP, __pyx_t_4) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":192
 *     NSIP = defs.IFT_NSIP
 *     SLIP = defs.IFT_SLIP
 *     ULTRA = defs.IFT_ULTRA             # <<<<<<<<<<<<<<
 *     DS3 = defs.IFT_DS3
 *     SIP = defs.IFT_SIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ULTRA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ULTRA, __pyx_t_4) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":193
 *     SLIP = defs.IFT_SLIP
 *     ULTRA = defs.IFT_ULTRA
 *     DS3 = defs.IFT_DS3             # <<<<<<<<<<<<<<
 *     SIP = defs.IFT_SIP
 *     FRELAY = defs.IFT_FRELAY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DS3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DS3, __pyx_t_4) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":194
 *     ULTRA = defs.IFT_ULTRA
 *     DS3 = defs.IFT_DS3
 *     SIP = defs.IFT_SIP             # <<<<<<<<<<<<<<
 *     FRELAY = defs.IFT_FRELAY
 *     RS232 = defs.IFT_RS232
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SIP, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":195
 *     DS3 = defs.IFT_DS3
 *     SIP = defs.IFT_SIP
 *     FRELAY = defs.IFT_FRELAY             # <<<<<<<<<<<<<<
 *     RS232 = defs.IFT_RS232
 *     PARA = defs.IFT_PARA
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRELAY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRELAY, __pyx_t_4) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":196
 *     SIP = defs.IFT_SIP
 *     FRELAY = defs.IFT_FRELAY
 *     RS232 = defs.IFT_RS232             # <<<<<<<<<<<<<<
 *     PARA = defs.IFT_PARA
 *     ARCNET = defs.IFT_ARCNET
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_RS232); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RS232, __pyx_t_4) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":197
 *     FRELAY = defs.IFT_FRELAY
 *     RS232 = defs.IFT_RS232
 *     PARA = defs.IFT_PARA             # <<<<<<<<<<<<<<
 *     ARCNET = defs.IFT_ARCNET
 *     ARCNETPLUS = defs.IFT_ARCNETPLUS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PARA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PARA, __pyx_t_4) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":198
 *     RS232 = defs.IFT_RS232
 *     PARA = defs.IFT_PARA
 *     ARCNET = defs.IFT_ARCNET             # <<<<<<<<<<<<<<
 *     ARCNETPLUS = defs.IFT_ARCNETPLUS
 *     ATM = defs.IFT_ATM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ARCNET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ARCNET, __pyx_t_4) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":199
 *     PARA = defs.IFT_PARA
 *     ARCNET = defs.IFT_ARCNET
 *     ARCNETPLUS = defs.IFT_ARCNETPLUS             # <<<<<<<<<<<<<<
 *     ATM = defs.IFT_ATM
 *     MIOX25 = defs.IFT_MIOX25
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ARCNETPLUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ARCNETPLUS, __pyx_t_4) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":200
 *     ARCNET = defs.IFT_ARCNET
 *     ARCNETPLUS = defs.IFT_ARCNETPLUS
 *     ATM = defs.IFT_ATM             # <<<<<<<<<<<<<<
 *     MIOX25 = defs.IFT_MIOX25
 *     SONET = defs.IFT_SONET
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATM, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":201
 *     ARCNETPLUS = defs.IFT_ARCNETPLUS
 *     ATM = defs.IFT_ATM
 *     MIOX25 = defs.IFT_MIOX25             # <<<<<<<<<<<<<<
 *     SONET = defs.IFT_SONET
 *     X25PLE = defs.IFT_X25PLE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MIOX25); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MIOX25, __pyx_t_4) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":202
 *     ATM = defs.IFT_ATM
 *     MIOX25 = defs.IFT_MIOX25
 *     SONET = defs.IFT_SONET             # <<<<<<<<<<<<<<
 *     X25PLE = defs.IFT_X25PLE
 *     ISO88022LLC = defs.IFT_ISO88022LLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SONET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SONET, __pyx_t_4) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":203
 *     MIOX25 = defs.IFT_MIOX25
 *     SONET = defs.IFT_SONET
 *     X25PLE = defs.IFT_X25PLE             # <<<<<<<<<<<<<<
 *     ISO88022LLC = defs.IFT_ISO88022LLC
 *     LOCALTALK = defs.IFT_LOCALTALK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_X25PLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_X25PLE, __pyx_t_4) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":204
 *     SONET = defs.IFT_SONET
 *     X25PLE = defs.IFT_X25PLE
 *     ISO88022LLC = defs.IFT_ISO88022LLC             # <<<<<<<<<<<<<<
 *     LOCALTALK = defs.IFT_LOCALTALK
 *     SMDSDXI = defs.IFT_SMDSDXI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88022LLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88022LLC, __pyx_t_4) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":205
 *     X25PLE = defs.IFT_X25PLE
 *     ISO88022LLC = defs.IFT_ISO88022LLC
 *     LOCALTALK = defs.IFT_LOCALTALK             # <<<<<<<<<<<<<<
 *     SMDSDXI = defs.IFT_SMDSDXI
 *     FRELAYDCE = defs.IFT_FRELAYDCE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_LOCALTALK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOCALTALK, __pyx_t_4) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":206
 *     ISO88022LLC = defs.IFT_ISO88022LLC
 *     LOCALTALK = defs.IFT_LOCALTALK
 *     SMDSDXI = defs.IFT_SMDSDXI             # <<<<<<<<<<<<<<
 *     FRELAYDCE = defs.IFT_FRELAYDCE
 *     V35 = defs.IFT_V35
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SMDSDXI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SMDSDXI, __pyx_t_4) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":207
 *     LOCALTALK = defs.IFT_LOCALTALK
 *     SMDSDXI = defs.IFT_SMDSDXI
 *     FRELAYDCE = defs.IFT_FRELAYDCE             # <<<<<<<<<<<<<<
 *     V35 = defs.IFT_V35
 *     HSSI = defs.IFT_HSSI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRELAYDCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRELAYDCE, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":208
 *     SMDSDXI = defs.IFT_SMDSDXI
 *     FRELAYDCE = defs.IFT_FRELAYDCE
 *     V35 = defs.IFT_V35             # <<<<<<<<<<<<<<
 *     HSSI = defs.IFT_HSSI
 *     HIPPI = defs.IFT_HIPPI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_V35); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_V35, __pyx_t_4) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":209
 *     FRELAYDCE = defs.IFT_FRELAYDCE
 *     V35 = defs.IFT_V35
 *     HSSI = defs.IFT_HSSI             # <<<<<<<<<<<<<<
 *     HIPPI = defs.IFT_HIPPI
 *     MODEM = defs.IFT_MODEM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HSSI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HSSI, __pyx_t_4) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":210
 *     V35 = defs.IFT_V35
 *     HSSI = defs.IFT_HSSI
 *     HIPPI = defs.IFT_HIPPI             # <<<<<<<<<<<<<<
 *     MODEM = defs.IFT_MODEM
 *     AAL5 = defs.IFT_AAL5
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HIPPI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HIPPI, __pyx_t_4) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":211
 *     HSSI = defs.IFT_HSSI
 *     HIPPI = defs.IFT_HIPPI
 *     MODEM = defs.IFT_MODEM             # <<<<<<<<<<<<<<
 *     AAL5 = defs.IFT_AAL5
 *     SONETPATH = defs.IFT_SONETPATH
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MODEM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MODEM, __pyx_t_4) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":212
 *     HIPPI = defs.IFT_HIPPI
 *     MODEM = defs.IFT_MODEM
 *     AAL5 = defs.IFT_AAL5             # <<<<<<<<<<<<<<
 *     SONETPATH = defs.IFT_SONETPATH
 *     SONETVT = defs.IFT_SONETVT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_AAL5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AAL5, __pyx_t_4) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":213
 *     MODEM = defs.IFT_MODEM
 *     AAL5 = defs.IFT_AAL5
 *     SONETPATH = defs.IFT_SONETPATH             # <<<<<<<<<<<<<<
 *     SONETVT = defs.IFT_SONETVT
 *     SMDSICIP = defs.IFT_SMDSICIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SONETPATH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SONETPATH, __pyx_t_4) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":214
 *     AAL5 = defs.IFT_AAL5
 *     SONETPATH = defs.IFT_SONETPATH
 *     SONETVT = defs.IFT_SONETVT             # <<<<<<<<<<<<<<
 *     SMDSICIP = defs.IFT_SMDSICIP
 *     PROPVIRTUAL = defs.IFT_PROPVIRTUAL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SONETVT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SONETVT, __pyx_t_4) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":215
 *     SONETPATH = defs.IFT_SONETPATH
 *     SONETVT = defs.IFT_SONETVT
 *     SMDSICIP = defs.IFT_SMDSICIP             # <<<<<<<<<<<<<<
 *     PROPVIRTUAL = defs.IFT_PROPVIRTUAL
 *     PROPMUX = defs.IFT_PROPMUX
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SMDSICIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SMDSICIP, __pyx_t_4) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":216
 *     SONETVT = defs.IFT_SONETVT
 *     SMDSICIP = defs.IFT_SMDSICIP
 *     PROPVIRTUAL = defs.IFT_PROPVIRTUAL             # <<<<<<<<<<<<<<
 *     PROPMUX = defs.IFT_PROPMUX
 *     IEEE80212 = defs.IFT_IEEE80212
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPVIRTUAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPVIRTUAL, __pyx_t_4) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":217
 *     SMDSICIP = defs.IFT_SMDSICIP
 *     PROPVIRTUAL = defs.IFT_PROPVIRTUAL
 *     PROPMUX = defs.IFT_PROPMUX             # <<<<<<<<<<<<<<
 *     IEEE80212 = defs.IFT_IEEE80212
 *     FIBRECHANNEL = defs.IFT_FIBRECHANNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPMUX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPMUX, __pyx_t_4) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":218
 *     PROPVIRTUAL = defs.IFT_PROPVIRTUAL
 *     PROPMUX = defs.IFT_PROPMUX
 *     IEEE80212 = defs.IFT_IEEE80212             # <<<<<<<<<<<<<<
 *     FIBRECHANNEL = defs.IFT_FIBRECHANNEL
 *     HIPPIINTERFACE = defs.IFT_HIPPIINTERFACE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IEEE80212); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IEEE80212, __pyx_t_4) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":219
 *     PROPMUX = defs.IFT_PROPMUX
 *     IEEE80212 = defs.IFT_IEEE80212
 *     FIBRECHANNEL = defs.IFT_FIBRECHANNEL             # <<<<<<<<<<<<<<
 *     HIPPIINTERFACE = defs.IFT_HIPPIINTERFACE
 *     FRAMERELAYINTERCONNECT = defs.IFT_FRAMERELAYINTERCONNECT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FIBRECHANNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FIBRECHANNEL, __pyx_t_4) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":220
 *     IEEE80212 = defs.IFT_IEEE80212
 *     FIBRECHANNEL = defs.IFT_FIBRECHANNEL
 *     HIPPIINTERFACE = defs.IFT_HIPPIINTERFACE             # <<<<<<<<<<<<<<
 *     FRAMERELAYINTERCONNECT = defs.IFT_FRAMERELAYINTERCONNECT
 *     AFLANE8023 = defs.IFT_AFLANE8023
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HIPPIINTERFACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HIPPIINTERFACE, __pyx_t_4) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":221
 *     FIBRECHANNEL = defs.IFT_FIBRECHANNEL
 *     HIPPIINTERFACE = defs.IFT_HIPPIINTERFACE
 *     FRAMERELAYINTERCONNECT = defs.IFT_FRAMERELAYINTERCONNECT             # <<<<<<<<<<<<<<
 *     AFLANE8023 = defs.IFT_AFLANE8023
 *     AFLANE8025 = defs.IFT_AFLANE8025
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRAMERELAYINTERCONNECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRAMERELAYINTERCONNECT, __pyx_t_4) < 0) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":222
 *     HIPPIINTERFACE = defs.IFT_HIPPIINTERFACE
 *     FRAMERELAYINTERCONNECT = defs.IFT_FRAMERELAYINTERCONNECT
 *     AFLANE8023 = defs.IFT_AFLANE8023             # <<<<<<<<<<<<<<
 *     AFLANE8025 = defs.IFT_AFLANE8025
 *     CCTEMUL = defs.IFT_CCTEMUL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_AFLANE8023); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AFLANE8023, __pyx_t_4) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":223
 *     FRAMERELAYINTERCONNECT = defs.IFT_FRAMERELAYINTERCONNECT
 *     AFLANE8023 = defs.IFT_AFLANE8023
 *     AFLANE8025 = defs.IFT_AFLANE8025             # <<<<<<<<<<<<<<
 *     CCTEMUL = defs.IFT_CCTEMUL
 *     FASTETHER = defs.IFT_FASTETHER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_AFLANE8025); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AFLANE8025, __pyx_t_4) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":224
 *     AFLANE8023 = defs.IFT_AFLANE8023
 *     AFLANE8025 = defs.IFT_AFLANE8025
 *     CCTEMUL = defs.IFT_CCTEMUL             # <<<<<<<<<<<<<<
 *     FASTETHER = defs.IFT_FASTETHER
 *     ISDN = defs.IFT_ISDN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_CCTEMUL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CCTEMUL, __pyx_t_4) < 0) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":225
 *     AFLANE8025 = defs.IFT_AFLANE8025
 *     CCTEMUL = defs.IFT_CCTEMUL
 *     FASTETHER = defs.IFT_FASTETHER             # <<<<<<<<<<<<<<
 *     ISDN = defs.IFT_ISDN
 *     V11 = defs.IFT_V11
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FASTETHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FASTETHER, __pyx_t_4) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":226
 *     CCTEMUL = defs.IFT_CCTEMUL
 *     FASTETHER = defs.IFT_FASTETHER
 *     ISDN = defs.IFT_ISDN             # <<<<<<<<<<<<<<
 *     V11 = defs.IFT_V11
 *     V36 = defs.IFT_V36
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISDN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISDN, __pyx_t_4) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":227
 *     FASTETHER = defs.IFT_FASTETHER
 *     ISDN = defs.IFT_ISDN
 *     V11 = defs.IFT_V11             # <<<<<<<<<<<<<<
 *     V36 = defs.IFT_V36
 *     G703AT64K = defs.IFT_G703AT64K
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_V11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_V11, __pyx_t_4) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":228
 *     ISDN = defs.IFT_ISDN
 *     V11 = defs.IFT_V11
 *     V36 = defs.IFT_V36             # <<<<<<<<<<<<<<
 *     G703AT64K = defs.IFT_G703AT64K
 *     G703AT2MB = defs.IFT_G703AT2MB
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_V36); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_V36, __pyx_t_4) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":229
 *     V11 = defs.IFT_V11
 *     V36 = defs.IFT_V36
 *     G703AT64K = defs.IFT_G703AT64K             # <<<<<<<<<<<<<<
 *     G703AT2MB = defs.IFT_G703AT2MB
 *     QLLC = defs.IFT_QLLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_G703AT64K); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_G703AT64K, __pyx_t_4) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":230
 *     V36 = defs.IFT_V36
 *     G703AT64K = defs.IFT_G703AT64K
 *     G703AT2MB = defs.IFT_G703AT2MB             # <<<<<<<<<<<<<<
 *     QLLC = defs.IFT_QLLC
 *     FASTETHERFX = defs.IFT_FASTETHERFX
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_G703AT2MB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_G703AT2MB, __pyx_t_4) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":231
 *     G703AT64K = defs.IFT_G703AT64K
 *     G703AT2MB = defs.IFT_G703AT2MB
 *     QLLC = defs.IFT_QLLC             # <<<<<<<<<<<<<<
 *     FASTETHERFX = defs.IFT_FASTETHERFX
 *     CHANNEL = defs.IFT_CHANNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_QLLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_QLLC, __pyx_t_4) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":232
 *     G703AT2MB = defs.IFT_G703AT2MB
 *     QLLC = defs.IFT_QLLC
 *     FASTETHERFX = defs.IFT_FASTETHERFX             # <<<<<<<<<<<<<<
 *     CHANNEL = defs.IFT_CHANNEL
 *     IEEE80211 = defs.IFT_IEEE80211
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FASTETHERFX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FASTETHERFX, __pyx_t_4) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":233
 *     QLLC = defs.IFT_QLLC
 *     FASTETHERFX = defs.IFT_FASTETHERFX
 *     CHANNEL = defs.IFT_CHANNEL             # <<<<<<<<<<<<<<
 *     IEEE80211 = defs.IFT_IEEE80211
 *     IBM370PARCHAN = defs.IFT_IBM370PARCHAN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_CHANNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CHANNEL, __pyx_t_4) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":234
 *     FASTETHERFX = defs.IFT_FASTETHERFX
 *     CHANNEL = defs.IFT_CHANNEL
 *     IEEE80211 = defs.IFT_IEEE80211             # <<<<<<<<<<<<<<
 *     IBM370PARCHAN = defs.IFT_IBM370PARCHAN
 *     ESCON = defs.IFT_ESCON
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IEEE80211); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IEEE80211, __pyx_t_4) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":235
 *     CHANNEL = defs.IFT_CHANNEL
 *     IEEE80211 = defs.IFT_IEEE80211
 *     IBM370PARCHAN = defs.IFT_IBM370PARCHAN             # <<<<<<<<<<<<<<
 *     ESCON = defs.IFT_ESCON
 *     DLSW = defs.IFT_DLSW
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IBM370PARCHAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IBM370PARCHAN, __pyx_t_4) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":236
 *     IEEE80211 = defs.IFT_IEEE80211
 *     IBM370PARCHAN = defs.IFT_IBM370PARCHAN
 *     ESCON = defs.IFT_ESCON             # <<<<<<<<<<<<<<
 *     DLSW = defs.IFT_DLSW
 *     ISDNS = defs.IFT_ISDNS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ESCON); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ESCON, __pyx_t_4) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":237
 *     IBM370PARCHAN = defs.IFT_IBM370PARCHAN
 *     ESCON = defs.IFT_ESCON
 *     DLSW = defs.IFT_DLSW             # <<<<<<<<<<<<<<
 *     ISDNS = defs.IFT_ISDNS
 *     ISDNU = defs.IFT_ISDNU
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DLSW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DLSW, __pyx_t_4) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":238
 *     ESCON = defs.IFT_ESCON
 *     DLSW = defs.IFT_DLSW
 *     ISDNS = defs.IFT_ISDNS             # <<<<<<<<<<<<<<
 *     ISDNU = defs.IFT_ISDNU
 *     LAPD = defs.IFT_LAPD
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISDNS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISDNS, __pyx_t_4) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":239
 *     DLSW = defs.IFT_DLSW
 *     ISDNS = defs.IFT_ISDNS
 *     ISDNU = defs.IFT_ISDNU             # <<<<<<<<<<<<<<
 *     LAPD = defs.IFT_LAPD
 *     IPSWITCH = defs.IFT_IPSWITCH
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISDNU); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISDNU, __pyx_t_4) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":240
 *     ISDNS = defs.IFT_ISDNS
 *     ISDNU = defs.IFT_ISDNU
 *     LAPD = defs.IFT_LAPD             # <<<<<<<<<<<<<<
 *     IPSWITCH = defs.IFT_IPSWITCH
 *     RSRB = defs.IFT_RSRB
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_LAPD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LAPD, __pyx_t_4) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":241
 *     ISDNU = defs.IFT_ISDNU
 *     LAPD = defs.IFT_LAPD
 *     IPSWITCH = defs.IFT_IPSWITCH             # <<<<<<<<<<<<<<
 *     RSRB = defs.IFT_RSRB
 *     ATMLOGICAL = defs.IFT_ATMLOGICAL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IPSWITCH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IPSWITCH, __pyx_t_4) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":242
 *     LAPD = defs.IFT_LAPD
 *     IPSWITCH = defs.IFT_IPSWITCH
 *     RSRB = defs.IFT_RSRB             # <<<<<<<<<<<<<<
 *     ATMLOGICAL = defs.IFT_ATMLOGICAL
 *     DS0 = defs.IFT_DS0
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_RSRB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RSRB, __pyx_t_4) < 0) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":243
 *     IPSWITCH = defs.IFT_IPSWITCH
 *     RSRB = defs.IFT_RSRB
 *     ATMLOGICAL = defs.IFT_ATMLOGICAL             # <<<<<<<<<<<<<<
 *     DS0 = defs.IFT_DS0
 *     DS0BUNDLE = defs.IFT_DS0BUNDLE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMLOGICAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMLOGICAL, __pyx_t_4) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":244
 *     RSRB = defs.IFT_RSRB
 *     ATMLOGICAL = defs.IFT_ATMLOGICAL
 *     DS0 = defs.IFT_DS0             # <<<<<<<<<<<<<<
 *     DS0BUNDLE = defs.IFT_DS0BUNDLE
 *     BSC = defs.IFT_BSC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DS0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DS0, __pyx_t_4) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":245
 *     ATMLOGICAL = defs.IFT_ATMLOGICAL
 *     DS0 = defs.IFT_DS0
 *     DS0BUNDLE = defs.IFT_DS0BUNDLE             # <<<<<<<<<<<<<<
 *     BSC = defs.IFT_BSC
 *     ASYNC = defs.IFT_ASYNC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DS0BUNDLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DS0BUNDLE, __pyx_t_4) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":246
 *     DS0 = defs.IFT_DS0
 *     DS0BUNDLE = defs.IFT_DS0BUNDLE
 *     BSC = defs.IFT_BSC             # <<<<<<<<<<<<<<
 *     ASYNC = defs.IFT_ASYNC
 *     CNR = defs.IFT_CNR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_BSC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BSC, __pyx_t_4) < 0) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":247
 *     DS0BUNDLE = defs.IFT_DS0BUNDLE
 *     BSC = defs.IFT_BSC
 *     ASYNC = defs.IFT_ASYNC             # <<<<<<<<<<<<<<
 *     CNR = defs.IFT_CNR
 *     ISO88025DTR = defs.IFT_ISO88025DTR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ASYNC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ASYNC, __pyx_t_4) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":248
 *     BSC = defs.IFT_BSC
 *     ASYNC = defs.IFT_ASYNC
 *     CNR = defs.IFT_CNR             # <<<<<<<<<<<<<<
 *     ISO88025DTR = defs.IFT_ISO88025DTR
 *     EPLRS = defs.IFT_EPLRS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_CNR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CNR, __pyx_t_4) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":249
 *     ASYNC = defs.IFT_ASYNC
 *     CNR = defs.IFT_CNR
 *     ISO88025DTR = defs.IFT_ISO88025DTR             # <<<<<<<<<<<<<<
 *     EPLRS = defs.IFT_EPLRS
 *     ARAP = defs.IFT_ARAP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88025DTR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88025DTR, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":250
 *     CNR = defs.IFT_CNR
 *     ISO88025DTR = defs.IFT_ISO88025DTR
 *     EPLRS = defs.IFT_EPLRS             # <<<<<<<<<<<<<<
 *     ARAP = defs.IFT_ARAP
 *     PROPCNLS = defs.IFT_PROPCNLS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_EPLRS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_EPLRS, __pyx_t_4) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":251
 *     ISO88025DTR = defs.IFT_ISO88025DTR
 *     EPLRS = defs.IFT_EPLRS
 *     ARAP = defs.IFT_ARAP             # <<<<<<<<<<<<<<
 *     PROPCNLS = defs.IFT_PROPCNLS
 *     HOSTPAD = defs.IFT_HOSTPAD
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ARAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ARAP, __pyx_t_4) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":252
 *     EPLRS = defs.IFT_EPLRS
 *     ARAP = defs.IFT_ARAP
 *     PROPCNLS = defs.IFT_PROPCNLS             # <<<<<<<<<<<<<<
 *     HOSTPAD = defs.IFT_HOSTPAD
 *     TERMPAD = defs.IFT_TERMPAD
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPCNLS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPCNLS, __pyx_t_4) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":253
 *     ARAP = defs.IFT_ARAP
 *     PROPCNLS = defs.IFT_PROPCNLS
 *     HOSTPAD = defs.IFT_HOSTPAD             # <<<<<<<<<<<<<<
 *     TERMPAD = defs.IFT_TERMPAD
 *     FRAMERELAYMPI = defs.IFT_FRAMERELAYMPI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HOSTPAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HOSTPAD, __pyx_t_4) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":254
 *     PROPCNLS = defs.IFT_PROPCNLS
 *     HOSTPAD = defs.IFT_HOSTPAD
 *     TERMPAD = defs.IFT_TERMPAD             # <<<<<<<<<<<<<<
 *     FRAMERELAYMPI = defs.IFT_FRAMERELAYMPI
 *     X213 = defs.IFT_X213
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_TERMPAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TERMPAD, __pyx_t_4) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":255
 *     HOSTPAD = defs.IFT_HOSTPAD
 *     TERMPAD = defs.IFT_TERMPAD
 *     FRAMERELAYMPI = defs.IFT_FRAMERELAYMPI             # <<<<<<<<<<<<<<
 *     X213 = defs.IFT_X213
 *     ADSL = defs.IFT_ADSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRAMERELAYMPI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRAMERELAYMPI, __pyx_t_4) < 0) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":256
 *     TERMPAD = defs.IFT_TERMPAD
 *     FRAMERELAYMPI = defs.IFT_FRAMERELAYMPI
 *     X213 = defs.IFT_X213             # <<<<<<<<<<<<<<
 *     ADSL = defs.IFT_ADSL
 *     RADSL = defs.IFT_RADSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_X213); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_X213, __pyx_t_4) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":257
 *     FRAMERELAYMPI = defs.IFT_FRAMERELAYMPI
 *     X213 = defs.IFT_X213
 *     ADSL = defs.IFT_ADSL             # <<<<<<<<<<<<<<
 *     RADSL = defs.IFT_RADSL
 *     SDSL = defs.IFT_SDSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ADSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ADSL, __pyx_t_4) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":258
 *     X213 = defs.IFT_X213
 *     ADSL = defs.IFT_ADSL
 *     RADSL = defs.IFT_RADSL             # <<<<<<<<<<<<<<
 *     SDSL = defs.IFT_SDSL
 *     VDSL = defs.IFT_VDSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_RADSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RADSL, __pyx_t_4) < 0) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":259
 *     ADSL = defs.IFT_ADSL
 *     RADSL = defs.IFT_RADSL
 *     SDSL = defs.IFT_SDSL             # <<<<<<<<<<<<<<
 *     VDSL = defs.IFT_VDSL
 *     ISO88025CRFPINT = defs.IFT_ISO88025CRFPINT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SDSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SDSL, __pyx_t_4) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":260
 *     RADSL = defs.IFT_RADSL
 *     SDSL = defs.IFT_SDSL
 *     VDSL = defs.IFT_VDSL             # <<<<<<<<<<<<<<
 *     ISO88025CRFPINT = defs.IFT_ISO88025CRFPINT
 *     MYRINET = defs.IFT_MYRINET
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VDSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VDSL, __pyx_t_4) < 0) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":261
 *     SDSL = defs.IFT_SDSL
 *     VDSL = defs.IFT_VDSL
 *     ISO88025CRFPINT = defs.IFT_ISO88025CRFPINT             # <<<<<<<<<<<<<<
 *     MYRINET = defs.IFT_MYRINET
 *     VOICEEM = defs.IFT_VOICEEM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88025CRFPINT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88025CRFPINT, __pyx_t_4) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":262
 *     VDSL = defs.IFT_VDSL
 *     ISO88025CRFPINT = defs.IFT_ISO88025CRFPINT
 *     MYRINET = defs.IFT_MYRINET             # <<<<<<<<<<<<<<
 *     VOICEEM = defs.IFT_VOICEEM
 *     VOICEFXO = defs.IFT_VOICEFXO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MYRINET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MYRINET, __pyx_t_4) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":263
 *     ISO88025CRFPINT = defs.IFT_ISO88025CRFPINT
 *     MYRINET = defs.IFT_MYRINET
 *     VOICEEM = defs.IFT_VOICEEM             # <<<<<<<<<<<<<<
 *     VOICEFXO = defs.IFT_VOICEFXO
 *     VOICEFXS = defs.IFT_VOICEFXS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEEM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEEM, __pyx_t_4) < 0) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":264
 *     MYRINET = defs.IFT_MYRINET
 *     VOICEEM = defs.IFT_VOICEEM
 *     VOICEFXO = defs.IFT_VOICEFXO             # <<<<<<<<<<<<<<
 *     VOICEFXS = defs.IFT_VOICEFXS
 *     VOICEENCAP = defs.IFT_VOICEENCAP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEFXO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEFXO, __pyx_t_4) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":265
 *     VOICEEM = defs.IFT_VOICEEM
 *     VOICEFXO = defs.IFT_VOICEFXO
 *     VOICEFXS = defs.IFT_VOICEFXS             # <<<<<<<<<<<<<<
 *     VOICEENCAP = defs.IFT_VOICEENCAP
 *     VOICEOVERIP = defs.IFT_VOICEOVERIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEFXS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEFXS, __pyx_t_4) < 0) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":266
 *     VOICEFXO = defs.IFT_VOICEFXO
 *     VOICEFXS = defs.IFT_VOICEFXS
 *     VOICEENCAP = defs.IFT_VOICEENCAP             # <<<<<<<<<<<<<<
 *     VOICEOVERIP = defs.IFT_VOICEOVERIP
 *     ATMDXI = defs.IFT_ATMDXI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEENCAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEENCAP, __pyx_t_4) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":267
 *     VOICEFXS = defs.IFT_VOICEFXS
 *     VOICEENCAP = defs.IFT_VOICEENCAP
 *     VOICEOVERIP = defs.IFT_VOICEOVERIP             # <<<<<<<<<<<<<<
 *     ATMDXI = defs.IFT_ATMDXI
 *     ATMFUNI = defs.IFT_ATMFUNI
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEOVERIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEOVERIP, __pyx_t_4) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":268
 *     VOICEENCAP = defs.IFT_VOICEENCAP
 *     VOICEOVERIP = defs.IFT_VOICEOVERIP
 *     ATMDXI = defs.IFT_ATMDXI             # <<<<<<<<<<<<<<
 *     ATMFUNI = defs.IFT_ATMFUNI
 *     ATMIMA = defs.IFT_ATMIMA
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMDXI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMDXI, __pyx_t_4) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":269
 *     VOICEOVERIP = defs.IFT_VOICEOVERIP
 *     ATMDXI = defs.IFT_ATMDXI
 *     ATMFUNI = defs.IFT_ATMFUNI             # <<<<<<<<<<<<<<
 *     ATMIMA = defs.IFT_ATMIMA
 *     PPPMULTILINKBUNDLE = defs.IFT_PPPMULTILINKBUNDLE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMFUNI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMFUNI, __pyx_t_4) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":270
 *     ATMDXI = defs.IFT_ATMDXI
 *     ATMFUNI = defs.IFT_ATMFUNI
 *     ATMIMA = defs.IFT_ATMIMA             # <<<<<<<<<<<<<<
 *     PPPMULTILINKBUNDLE = defs.IFT_PPPMULTILINKBUNDLE
 *     IPOVERCDLC = defs.IFT_IPOVERCDLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMIMA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMIMA, __pyx_t_4) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":271
 *     ATMFUNI = defs.IFT_ATMFUNI
 *     ATMIMA = defs.IFT_ATMIMA
 *     PPPMULTILINKBUNDLE = defs.IFT_PPPMULTILINKBUNDLE             # <<<<<<<<<<<<<<
 *     IPOVERCDLC = defs.IFT_IPOVERCDLC
 *     IPOVERCLAW = defs.IFT_IPOVERCLAW
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PPPMULTILINKBUNDLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PPPMULTILINKBUNDLE, __pyx_t_4) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":272
 *     ATMIMA = defs.IFT_ATMIMA
 *     PPPMULTILINKBUNDLE = defs.IFT_PPPMULTILINKBUNDLE
 *     IPOVERCDLC = defs.IFT_IPOVERCDLC             # <<<<<<<<<<<<<<
 *     IPOVERCLAW = defs.IFT_IPOVERCLAW
 *     STACKTOSTACK = defs.IFT_STACKTOSTACK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IPOVERCDLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IPOVERCDLC, __pyx_t_4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":273
 *     PPPMULTILINKBUNDLE = defs.IFT_PPPMULTILINKBUNDLE
 *     IPOVERCDLC = defs.IFT_IPOVERCDLC
 *     IPOVERCLAW = defs.IFT_IPOVERCLAW             # <<<<<<<<<<<<<<
 *     STACKTOSTACK = defs.IFT_STACKTOSTACK
 *     VIRTUALIPADDRESS = defs.IFT_VIRTUALIPADDRESS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IPOVERCLAW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IPOVERCLAW, __pyx_t_4) < 0) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":274
 *     IPOVERCDLC = defs.IFT_IPOVERCDLC
 *     IPOVERCLAW = defs.IFT_IPOVERCLAW
 *     STACKTOSTACK = defs.IFT_STACKTOSTACK             # <<<<<<<<<<<<<<
 *     VIRTUALIPADDRESS = defs.IFT_VIRTUALIPADDRESS
 *     MPC = defs.IFT_MPC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_STACKTOSTACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STACKTOSTACK, __pyx_t_4) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":275
 *     IPOVERCLAW = defs.IFT_IPOVERCLAW
 *     STACKTOSTACK = defs.IFT_STACKTOSTACK
 *     VIRTUALIPADDRESS = defs.IFT_VIRTUALIPADDRESS             # <<<<<<<<<<<<<<
 *     MPC = defs.IFT_MPC
 *     IPOVERATM = defs.IFT_IPOVERATM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VIRTUALIPADDRESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VIRTUALIPADDRESS, __pyx_t_4) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":276
 *     STACKTOSTACK = defs.IFT_STACKTOSTACK
 *     VIRTUALIPADDRESS = defs.IFT_VIRTUALIPADDRESS
 *     MPC = defs.IFT_MPC             # <<<<<<<<<<<<<<
 *     IPOVERATM = defs.IFT_IPOVERATM
 *     ISO88025FIBER = defs.IFT_ISO88025FIBER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MPC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MPC, __pyx_t_4) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":277
 *     VIRTUALIPADDRESS = defs.IFT_VIRTUALIPADDRESS
 *     MPC = defs.IFT_MPC
 *     IPOVERATM = defs.IFT_IPOVERATM             # <<<<<<<<<<<<<<
 *     ISO88025FIBER = defs.IFT_ISO88025FIBER
 *     TDLC = defs.IFT_TDLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IPOVERATM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IPOVERATM, __pyx_t_4) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":278
 *     MPC = defs.IFT_MPC
 *     IPOVERATM = defs.IFT_IPOVERATM
 *     ISO88025FIBER = defs.IFT_ISO88025FIBER             # <<<<<<<<<<<<<<
 *     TDLC = defs.IFT_TDLC
 *     GIGABITETHERNET = defs.IFT_GIGABITETHERNET
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISO88025FIBER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISO88025FIBER, __pyx_t_4) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":279
 *     IPOVERATM = defs.IFT_IPOVERATM
 *     ISO88025FIBER = defs.IFT_ISO88025FIBER
 *     TDLC = defs.IFT_TDLC             # <<<<<<<<<<<<<<
 *     GIGABITETHERNET = defs.IFT_GIGABITETHERNET
 *     HDLC = defs.IFT_HDLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_TDLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TDLC, __pyx_t_4) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":280
 *     ISO88025FIBER = defs.IFT_ISO88025FIBER
 *     TDLC = defs.IFT_TDLC
 *     GIGABITETHERNET = defs.IFT_GIGABITETHERNET             # <<<<<<<<<<<<<<
 *     HDLC = defs.IFT_HDLC
 *     LAPF = defs.IFT_LAPF
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_GIGABITETHERNET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_GIGABITETHERNET, __pyx_t_4) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":281
 *     TDLC = defs.IFT_TDLC
 *     GIGABITETHERNET = defs.IFT_GIGABITETHERNET
 *     HDLC = defs.IFT_HDLC             # <<<<<<<<<<<<<<
 *     LAPF = defs.IFT_LAPF
 *     V37 = defs.IFT_V37
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HDLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HDLC, __pyx_t_4) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":282
 *     GIGABITETHERNET = defs.IFT_GIGABITETHERNET
 *     HDLC = defs.IFT_HDLC
 *     LAPF = defs.IFT_LAPF             # <<<<<<<<<<<<<<
 *     V37 = defs.IFT_V37
 *     X25MLP = defs.IFT_X25MLP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_LAPF); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LAPF, __pyx_t_4) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":283
 *     HDLC = defs.IFT_HDLC
 *     LAPF = defs.IFT_LAPF
 *     V37 = defs.IFT_V37             # <<<<<<<<<<<<<<
 *     X25MLP = defs.IFT_X25MLP
 *     X25HUNTGROUP = defs.IFT_X25HUNTGROUP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_V37); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_V37, __pyx_t_4) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":284
 *     LAPF = defs.IFT_LAPF
 *     V37 = defs.IFT_V37
 *     X25MLP = defs.IFT_X25MLP             # <<<<<<<<<<<<<<
 *     X25HUNTGROUP = defs.IFT_X25HUNTGROUP
 *     TRANSPHDLC = defs.IFT_TRANSPHDLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_X25MLP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_X25MLP, __pyx_t_4) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":285
 *     V37 = defs.IFT_V37
 *     X25MLP = defs.IFT_X25MLP
 *     X25HUNTGROUP = defs.IFT_X25HUNTGROUP             # <<<<<<<<<<<<<<
 *     TRANSPHDLC = defs.IFT_TRANSPHDLC
 *     INTERLEAVE = defs.IFT_INTERLEAVE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_X25HUNTGROUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_X25HUNTGROUP, __pyx_t_4) < 0) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":286
 *     X25MLP = defs.IFT_X25MLP
 *     X25HUNTGROUP = defs.IFT_X25HUNTGROUP
 *     TRANSPHDLC = defs.IFT_TRANSPHDLC             # <<<<<<<<<<<<<<
 *     INTERLEAVE = defs.IFT_INTERLEAVE
 *     FAST = defs.IFT_FAST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_TRANSPHDLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TRANSPHDLC, __pyx_t_4) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":287
 *     X25HUNTGROUP = defs.IFT_X25HUNTGROUP
 *     TRANSPHDLC = defs.IFT_TRANSPHDLC
 *     INTERLEAVE = defs.IFT_INTERLEAVE             # <<<<<<<<<<<<<<
 *     FAST = defs.IFT_FAST
 *     IP = defs.IFT_IP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_INTERLEAVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INTERLEAVE, __pyx_t_4) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":288
 *     TRANSPHDLC = defs.IFT_TRANSPHDLC
 *     INTERLEAVE = defs.IFT_INTERLEAVE
 *     FAST = defs.IFT_FAST             # <<<<<<<<<<<<<<
 *     IP = defs.IFT_IP
 *     DOCSCABLEMACLAYER = defs.IFT_DOCSCABLEMACLAYER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FAST, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":289
 *     INTERLEAVE = defs.IFT_INTERLEAVE
 *     FAST = defs.IFT_FAST
 *     IP = defs.IFT_IP             # <<<<<<<<<<<<<<
 *     DOCSCABLEMACLAYER = defs.IFT_DOCSCABLEMACLAYER
 *     DOCSCABLEDOWNSTREAM = defs.IFT_DOCSCABLEDOWNSTREAM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IP, __pyx_t_4) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":290
 *     FAST = defs.IFT_FAST
 *     IP = defs.IFT_IP
 *     DOCSCABLEMACLAYER = defs.IFT_DOCSCABLEMACLAYER             # <<<<<<<<<<<<<<
 *     DOCSCABLEDOWNSTREAM = defs.IFT_DOCSCABLEDOWNSTREAM
 *     DOCSCABLEUPSTREAM = defs.IFT_DOCSCABLEUPSTREAM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DOCSCABLEMACLAYER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DOCSCABLEMACLAYER, __pyx_t_4) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":291
 *     IP = defs.IFT_IP
 *     DOCSCABLEMACLAYER = defs.IFT_DOCSCABLEMACLAYER
 *     DOCSCABLEDOWNSTREAM = defs.IFT_DOCSCABLEDOWNSTREAM             # <<<<<<<<<<<<<<
 *     DOCSCABLEUPSTREAM = defs.IFT_DOCSCABLEUPSTREAM
 *     A12MPPSWITCH = defs.IFT_A12MPPSWITCH
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DOCSCABLEDOWNSTREAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DOCSCABLEDOWNSTREAM, __pyx_t_4) < 0) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":292
 *     DOCSCABLEMACLAYER = defs.IFT_DOCSCABLEMACLAYER
 *     DOCSCABLEDOWNSTREAM = defs.IFT_DOCSCABLEDOWNSTREAM
 *     DOCSCABLEUPSTREAM = defs.IFT_DOCSCABLEUPSTREAM             # <<<<<<<<<<<<<<
 *     A12MPPSWITCH = defs.IFT_A12MPPSWITCH
 *     TUNNEL = defs.IFT_TUNNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DOCSCABLEUPSTREAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DOCSCABLEUPSTREAM, __pyx_t_4) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":293
 *     DOCSCABLEDOWNSTREAM = defs.IFT_DOCSCABLEDOWNSTREAM
 *     DOCSCABLEUPSTREAM = defs.IFT_DOCSCABLEUPSTREAM
 *     A12MPPSWITCH = defs.IFT_A12MPPSWITCH             # <<<<<<<<<<<<<<
 *     TUNNEL = defs.IFT_TUNNEL
 *     COFFEE = defs.IFT_COFFEE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_A12MPPSWITCH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_A12MPPSWITCH, __pyx_t_4) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":294
 *     DOCSCABLEUPSTREAM = defs.IFT_DOCSCABLEUPSTREAM
 *     A12MPPSWITCH = defs.IFT_A12MPPSWITCH
 *     TUNNEL = defs.IFT_TUNNEL             # <<<<<<<<<<<<<<
 *     COFFEE = defs.IFT_COFFEE
 *     CES = defs.IFT_CES
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_TUNNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TUNNEL, __pyx_t_4) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":295
 *     A12MPPSWITCH = defs.IFT_A12MPPSWITCH
 *     TUNNEL = defs.IFT_TUNNEL
 *     COFFEE = defs.IFT_COFFEE             # <<<<<<<<<<<<<<
 *     CES = defs.IFT_CES
 *     ATMSUBINTERFACE = defs.IFT_ATMSUBINTERFACE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_COFFEE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_COFFEE, __pyx_t_4) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":296
 *     TUNNEL = defs.IFT_TUNNEL
 *     COFFEE = defs.IFT_COFFEE
 *     CES = defs.IFT_CES             # <<<<<<<<<<<<<<
 *     ATMSUBINTERFACE = defs.IFT_ATMSUBINTERFACE
 *     L2VLAN = defs.IFT_L2VLAN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_CES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_CES, __pyx_t_4) < 0) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":297
 *     COFFEE = defs.IFT_COFFEE
 *     CES = defs.IFT_CES
 *     ATMSUBINTERFACE = defs.IFT_ATMSUBINTERFACE             # <<<<<<<<<<<<<<
 *     L2VLAN = defs.IFT_L2VLAN
 *     L3IPVLAN = defs.IFT_L3IPVLAN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMSUBINTERFACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMSUBINTERFACE, __pyx_t_4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":298
 *     CES = defs.IFT_CES
 *     ATMSUBINTERFACE = defs.IFT_ATMSUBINTERFACE
 *     L2VLAN = defs.IFT_L2VLAN             # <<<<<<<<<<<<<<
 *     L3IPVLAN = defs.IFT_L3IPVLAN
 *     L3IPXVLAN = defs.IFT_L3IPXVLAN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_L2VLAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_L2VLAN, __pyx_t_4) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":299
 *     ATMSUBINTERFACE = defs.IFT_ATMSUBINTERFACE
 *     L2VLAN = defs.IFT_L2VLAN
 *     L3IPVLAN = defs.IFT_L3IPVLAN             # <<<<<<<<<<<<<<
 *     L3IPXVLAN = defs.IFT_L3IPXVLAN
 *     DIGITALPOWERLINE = defs.IFT_DIGITALPOWERLINE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_L3IPVLAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_L3IPVLAN, __pyx_t_4) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":300
 *     L2VLAN = defs.IFT_L2VLAN
 *     L3IPVLAN = defs.IFT_L3IPVLAN
 *     L3IPXVLAN = defs.IFT_L3IPXVLAN             # <<<<<<<<<<<<<<
 *     DIGITALPOWERLINE = defs.IFT_DIGITALPOWERLINE
 *     MEDIAMAILOVERIP = defs.IFT_MEDIAMAILOVERIP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_L3IPXVLAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_L3IPXVLAN, __pyx_t_4) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":301
 *     L3IPVLAN = defs.IFT_L3IPVLAN
 *     L3IPXVLAN = defs.IFT_L3IPXVLAN
 *     DIGITALPOWERLINE = defs.IFT_DIGITALPOWERLINE             # <<<<<<<<<<<<<<
 *     MEDIAMAILOVERIP = defs.IFT_MEDIAMAILOVERIP
 *     DTM = defs.IFT_DTM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DIGITALPOWERLINE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DIGITALPOWERLINE, __pyx_t_4) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":302
 *     L3IPXVLAN = defs.IFT_L3IPXVLAN
 *     DIGITALPOWERLINE = defs.IFT_DIGITALPOWERLINE
 *     MEDIAMAILOVERIP = defs.IFT_MEDIAMAILOVERIP             # <<<<<<<<<<<<<<
 *     DTM = defs.IFT_DTM
 *     DCN = defs.IFT_DCN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MEDIAMAILOVERIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MEDIAMAILOVERIP, __pyx_t_4) < 0) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":303
 *     DIGITALPOWERLINE = defs.IFT_DIGITALPOWERLINE
 *     MEDIAMAILOVERIP = defs.IFT_MEDIAMAILOVERIP
 *     DTM = defs.IFT_DTM             # <<<<<<<<<<<<<<
 *     DCN = defs.IFT_DCN
 *     IPFORWARD = defs.IFT_IPFORWARD
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DTM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DTM, __pyx_t_4) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":304
 *     MEDIAMAILOVERIP = defs.IFT_MEDIAMAILOVERIP
 *     DTM = defs.IFT_DTM
 *     DCN = defs.IFT_DCN             # <<<<<<<<<<<<<<
 *     IPFORWARD = defs.IFT_IPFORWARD
 *     MSDSL = defs.IFT_MSDSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DCN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DCN, __pyx_t_4) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":305
 *     DTM = defs.IFT_DTM
 *     DCN = defs.IFT_DCN
 *     IPFORWARD = defs.IFT_IPFORWARD             # <<<<<<<<<<<<<<
 *     MSDSL = defs.IFT_MSDSL
 *     IEEE1394 = defs.IFT_IEEE1394
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IPFORWARD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IPFORWARD, __pyx_t_4) < 0) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":306
 *     DCN = defs.IFT_DCN
 *     IPFORWARD = defs.IFT_IPFORWARD
 *     MSDSL = defs.IFT_MSDSL             # <<<<<<<<<<<<<<
 *     IEEE1394 = defs.IFT_IEEE1394
 *     IFGSN = defs.IFT_IFGSN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MSDSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MSDSL, __pyx_t_4) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":307
 *     IPFORWARD = defs.IFT_IPFORWARD
 *     MSDSL = defs.IFT_MSDSL
 *     IEEE1394 = defs.IFT_IEEE1394             # <<<<<<<<<<<<<<
 *     IFGSN = defs.IFT_IFGSN
 *     DVBRCCMACLAYER = defs.IFT_DVBRCCMACLAYER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IEEE1394); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IEEE1394, __pyx_t_4) < 0) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":308
 *     MSDSL = defs.IFT_MSDSL
 *     IEEE1394 = defs.IFT_IEEE1394
 *     IFGSN = defs.IFT_IFGSN             # <<<<<<<<<<<<<<
 *     DVBRCCMACLAYER = defs.IFT_DVBRCCMACLAYER
 *     DVBRCCDOWNSTREAM = defs.IFT_DVBRCCDOWNSTREAM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IFGSN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IFGSN, __pyx_t_4) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":309
 *     IEEE1394 = defs.IFT_IEEE1394
 *     IFGSN = defs.IFT_IFGSN
 *     DVBRCCMACLAYER = defs.IFT_DVBRCCMACLAYER             # <<<<<<<<<<<<<<
 *     DVBRCCDOWNSTREAM = defs.IFT_DVBRCCDOWNSTREAM
 *     DVBRCCUPSTREAM = defs.IFT_DVBRCCUPSTREAM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DVBRCCMACLAYER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DVBRCCMACLAYER, __pyx_t_4) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":310
 *     IFGSN = defs.IFT_IFGSN
 *     DVBRCCMACLAYER = defs.IFT_DVBRCCMACLAYER
 *     DVBRCCDOWNSTREAM = defs.IFT_DVBRCCDOWNSTREAM             # <<<<<<<<<<<<<<
 *     DVBRCCUPSTREAM = defs.IFT_DVBRCCUPSTREAM
 *     ATMVIRTUAL = defs.IFT_ATMVIRTUAL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DVBRCCDOWNSTREAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DVBRCCDOWNSTREAM, __pyx_t_4) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":311
 *     DVBRCCMACLAYER = defs.IFT_DVBRCCMACLAYER
 *     DVBRCCDOWNSTREAM = defs.IFT_DVBRCCDOWNSTREAM
 *     DVBRCCUPSTREAM = defs.IFT_DVBRCCUPSTREAM             # <<<<<<<<<<<<<<
 *     ATMVIRTUAL = defs.IFT_ATMVIRTUAL
 *     MPLSTUNNEL = defs.IFT_MPLSTUNNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DVBRCCUPSTREAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DVBRCCUPSTREAM, __pyx_t_4) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":312
 *     DVBRCCDOWNSTREAM = defs.IFT_DVBRCCDOWNSTREAM
 *     DVBRCCUPSTREAM = defs.IFT_DVBRCCUPSTREAM
 *     ATMVIRTUAL = defs.IFT_ATMVIRTUAL             # <<<<<<<<<<<<<<
 *     MPLSTUNNEL = defs.IFT_MPLSTUNNEL
 *     SRP = defs.IFT_SRP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMVIRTUAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMVIRTUAL, __pyx_t_4) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":313
 *     DVBRCCUPSTREAM = defs.IFT_DVBRCCUPSTREAM
 *     ATMVIRTUAL = defs.IFT_ATMVIRTUAL
 *     MPLSTUNNEL = defs.IFT_MPLSTUNNEL             # <<<<<<<<<<<<<<
 *     SRP = defs.IFT_SRP
 *     VOICEOVERATM = defs.IFT_VOICEOVERATM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MPLSTUNNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MPLSTUNNEL, __pyx_t_4) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":314
 *     ATMVIRTUAL = defs.IFT_ATMVIRTUAL
 *     MPLSTUNNEL = defs.IFT_MPLSTUNNEL
 *     SRP = defs.IFT_SRP             # <<<<<<<<<<<<<<
 *     VOICEOVERATM = defs.IFT_VOICEOVERATM
 *     VOICEOVERFRAMERELAY = defs.IFT_VOICEOVERFRAMERELAY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SRP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SRP, __pyx_t_4) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":315
 *     MPLSTUNNEL = defs.IFT_MPLSTUNNEL
 *     SRP = defs.IFT_SRP
 *     VOICEOVERATM = defs.IFT_VOICEOVERATM             # <<<<<<<<<<<<<<
 *     VOICEOVERFRAMERELAY = defs.IFT_VOICEOVERFRAMERELAY
 *     IDSL = defs.IFT_IDSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEOVERATM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEOVERATM, __pyx_t_4) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":316
 *     SRP = defs.IFT_SRP
 *     VOICEOVERATM = defs.IFT_VOICEOVERATM
 *     VOICEOVERFRAMERELAY = defs.IFT_VOICEOVERFRAMERELAY             # <<<<<<<<<<<<<<
 *     IDSL = defs.IFT_IDSL
 *     COMPOSITELINK = defs.IFT_COMPOSITELINK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_VOICEOVERFRAMERELAY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VOICEOVERFRAMERELAY, __pyx_t_4) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":317
 *     VOICEOVERATM = defs.IFT_VOICEOVERATM
 *     VOICEOVERFRAMERELAY = defs.IFT_VOICEOVERFRAMERELAY
 *     IDSL = defs.IFT_IDSL             # <<<<<<<<<<<<<<
 *     COMPOSITELINK = defs.IFT_COMPOSITELINK
 *     SS7SIGLINK = defs.IFT_SS7SIGLINK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IDSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IDSL, __pyx_t_4) < 0) __PYX_ERR(0, 317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":318
 *     VOICEOVERFRAMERELAY = defs.IFT_VOICEOVERFRAMERELAY
 *     IDSL = defs.IFT_IDSL
 *     COMPOSITELINK = defs.IFT_COMPOSITELINK             # <<<<<<<<<<<<<<
 *     SS7SIGLINK = defs.IFT_SS7SIGLINK
 *     PROPWIRELESSP2P = defs.IFT_PROPWIRELESSP2P
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_COMPOSITELINK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_COMPOSITELINK, __pyx_t_4) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":319
 *     IDSL = defs.IFT_IDSL
 *     COMPOSITELINK = defs.IFT_COMPOSITELINK
 *     SS7SIGLINK = defs.IFT_SS7SIGLINK             # <<<<<<<<<<<<<<
 *     PROPWIRELESSP2P = defs.IFT_PROPWIRELESSP2P
 *     FRFORWARD = defs.IFT_FRFORWARD
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SS7SIGLINK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SS7SIGLINK, __pyx_t_4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":320
 *     COMPOSITELINK = defs.IFT_COMPOSITELINK
 *     SS7SIGLINK = defs.IFT_SS7SIGLINK
 *     PROPWIRELESSP2P = defs.IFT_PROPWIRELESSP2P             # <<<<<<<<<<<<<<
 *     FRFORWARD = defs.IFT_FRFORWARD
 *     RFC1483 = defs.IFT_RFC1483
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPWIRELESSP2P); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPWIRELESSP2P, __pyx_t_4) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":321
 *     SS7SIGLINK = defs.IFT_SS7SIGLINK
 *     PROPWIRELESSP2P = defs.IFT_PROPWIRELESSP2P
 *     FRFORWARD = defs.IFT_FRFORWARD             # <<<<<<<<<<<<<<
 *     RFC1483 = defs.IFT_RFC1483
 *     USB = defs.IFT_USB
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRFORWARD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRFORWARD, __pyx_t_4) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":322
 *     PROPWIRELESSP2P = defs.IFT_PROPWIRELESSP2P
 *     FRFORWARD = defs.IFT_FRFORWARD
 *     RFC1483 = defs.IFT_RFC1483             # <<<<<<<<<<<<<<
 *     USB = defs.IFT_USB
 *     IEEE8023ADLAG = defs.IFT_IEEE8023ADLAG
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_RFC1483); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RFC1483, __pyx_t_4) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":323
 *     FRFORWARD = defs.IFT_FRFORWARD
 *     RFC1483 = defs.IFT_RFC1483
 *     USB = defs.IFT_USB             # <<<<<<<<<<<<<<
 *     IEEE8023ADLAG = defs.IFT_IEEE8023ADLAG
 *     BGPPOLICYACCOUNTING = defs.IFT_BGPPOLICYACCOUNTING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_USB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_USB, __pyx_t_4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":324
 *     RFC1483 = defs.IFT_RFC1483
 *     USB = defs.IFT_USB
 *     IEEE8023ADLAG = defs.IFT_IEEE8023ADLAG             # <<<<<<<<<<<<<<
 *     BGPPOLICYACCOUNTING = defs.IFT_BGPPOLICYACCOUNTING
 *     FRF16MFRBUNDLE = defs.IFT_FRF16MFRBUNDLE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IEEE8023ADLAG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IEEE8023ADLAG, __pyx_t_4) < 0) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":325
 *     USB = defs.IFT_USB
 *     IEEE8023ADLAG = defs.IFT_IEEE8023ADLAG
 *     BGPPOLICYACCOUNTING = defs.IFT_BGPPOLICYACCOUNTING             # <<<<<<<<<<<<<<
 *     FRF16MFRBUNDLE = defs.IFT_FRF16MFRBUNDLE
 *     H323GATEKEEPER = defs.IFT_H323GATEKEEPER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_BGPPOLICYACCOUNTING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BGPPOLICYACCOUNTING, __pyx_t_4) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":326
 *     IEEE8023ADLAG = defs.IFT_IEEE8023ADLAG
 *     BGPPOLICYACCOUNTING = defs.IFT_BGPPOLICYACCOUNTING
 *     FRF16MFRBUNDLE = defs.IFT_FRF16MFRBUNDLE             # <<<<<<<<<<<<<<
 *     H323GATEKEEPER = defs.IFT_H323GATEKEEPER
 *     H323PROXY = defs.IFT_H323PROXY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRF16MFRBUNDLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRF16MFRBUNDLE, __pyx_t_4) < 0) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":327
 *     BGPPOLICYACCOUNTING = defs.IFT_BGPPOLICYACCOUNTING
 *     FRF16MFRBUNDLE = defs.IFT_FRF16MFRBUNDLE
 *     H323GATEKEEPER = defs.IFT_H323GATEKEEPER             # <<<<<<<<<<<<<<
 *     H323PROXY = defs.IFT_H323PROXY
 *     MPLS = defs.IFT_MPLS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_H323GATEKEEPER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_H323GATEKEEPER, __pyx_t_4) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":328
 *     FRF16MFRBUNDLE = defs.IFT_FRF16MFRBUNDLE
 *     H323GATEKEEPER = defs.IFT_H323GATEKEEPER
 *     H323PROXY = defs.IFT_H323PROXY             # <<<<<<<<<<<<<<
 *     MPLS = defs.IFT_MPLS
 *     MFSIGLINK = defs.IFT_MFSIGLINK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_H323PROXY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_H323PROXY, __pyx_t_4) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":329
 *     H323GATEKEEPER = defs.IFT_H323GATEKEEPER
 *     H323PROXY = defs.IFT_H323PROXY
 *     MPLS = defs.IFT_MPLS             # <<<<<<<<<<<<<<
 *     MFSIGLINK = defs.IFT_MFSIGLINK
 *     HDSL2 = defs.IFT_HDSL2
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MPLS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MPLS, __pyx_t_4) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":330
 *     H323PROXY = defs.IFT_H323PROXY
 *     MPLS = defs.IFT_MPLS
 *     MFSIGLINK = defs.IFT_MFSIGLINK             # <<<<<<<<<<<<<<
 *     HDSL2 = defs.IFT_HDSL2
 *     SHDSL = defs.IFT_SHDSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MFSIGLINK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MFSIGLINK, __pyx_t_4) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":331
 *     MPLS = defs.IFT_MPLS
 *     MFSIGLINK = defs.IFT_MFSIGLINK
 *     HDSL2 = defs.IFT_HDSL2             # <<<<<<<<<<<<<<
 *     SHDSL = defs.IFT_SHDSL
 *     DS1FDL = defs.IFT_DS1FDL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HDSL2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HDSL2, __pyx_t_4) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":332
 *     MFSIGLINK = defs.IFT_MFSIGLINK
 *     HDSL2 = defs.IFT_HDSL2
 *     SHDSL = defs.IFT_SHDSL             # <<<<<<<<<<<<<<
 *     DS1FDL = defs.IFT_DS1FDL
 *     POS = defs.IFT_POS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SHDSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SHDSL, __pyx_t_4) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":333
 *     HDSL2 = defs.IFT_HDSL2
 *     SHDSL = defs.IFT_SHDSL
 *     DS1FDL = defs.IFT_DS1FDL             # <<<<<<<<<<<<<<
 *     POS = defs.IFT_POS
 *     DVBASILN = defs.IFT_DVBASILN
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DS1FDL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DS1FDL, __pyx_t_4) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":334
 *     SHDSL = defs.IFT_SHDSL
 *     DS1FDL = defs.IFT_DS1FDL
 *     POS = defs.IFT_POS             # <<<<<<<<<<<<<<
 *     DVBASILN = defs.IFT_DVBASILN
 *     DVBASIOUT = defs.IFT_DVBASIOUT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_POS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_POS, __pyx_t_4) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":335
 *     DS1FDL = defs.IFT_DS1FDL
 *     POS = defs.IFT_POS
 *     DVBASILN = defs.IFT_DVBASILN             # <<<<<<<<<<<<<<
 *     DVBASIOUT = defs.IFT_DVBASIOUT
 *     PLC = defs.IFT_PLC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DVBASILN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DVBASILN, __pyx_t_4) < 0) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":336
 *     POS = defs.IFT_POS
 *     DVBASILN = defs.IFT_DVBASILN
 *     DVBASIOUT = defs.IFT_DVBASIOUT             # <<<<<<<<<<<<<<
 *     PLC = defs.IFT_PLC
 *     NFAS = defs.IFT_NFAS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DVBASIOUT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DVBASIOUT, __pyx_t_4) < 0) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":337
 *     DVBASILN = defs.IFT_DVBASILN
 *     DVBASIOUT = defs.IFT_DVBASIOUT
 *     PLC = defs.IFT_PLC             # <<<<<<<<<<<<<<
 *     NFAS = defs.IFT_NFAS
 *     TR008 = defs.IFT_TR008
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PLC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PLC, __pyx_t_4) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":338
 *     DVBASIOUT = defs.IFT_DVBASIOUT
 *     PLC = defs.IFT_PLC
 *     NFAS = defs.IFT_NFAS             # <<<<<<<<<<<<<<
 *     TR008 = defs.IFT_TR008
 *     GR303RDT = defs.IFT_GR303RDT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_NFAS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NFAS, __pyx_t_4) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":339
 *     PLC = defs.IFT_PLC
 *     NFAS = defs.IFT_NFAS
 *     TR008 = defs.IFT_TR008             # <<<<<<<<<<<<<<
 *     GR303RDT = defs.IFT_GR303RDT
 *     GR303IDT = defs.IFT_GR303IDT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_TR008); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TR008, __pyx_t_4) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":340
 *     NFAS = defs.IFT_NFAS
 *     TR008 = defs.IFT_TR008
 *     GR303RDT = defs.IFT_GR303RDT             # <<<<<<<<<<<<<<
 *     GR303IDT = defs.IFT_GR303IDT
 *     ISUP = defs.IFT_ISUP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_GR303RDT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_GR303RDT, __pyx_t_4) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":341
 *     TR008 = defs.IFT_TR008
 *     GR303RDT = defs.IFT_GR303RDT
 *     GR303IDT = defs.IFT_GR303IDT             # <<<<<<<<<<<<<<
 *     ISUP = defs.IFT_ISUP
 *     PROPDOCSWIRELESSMACLAYER = defs.IFT_PROPDOCSWIRELESSMACLAYER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_GR303IDT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_GR303IDT, __pyx_t_4) < 0) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":342
 *     GR303RDT = defs.IFT_GR303RDT
 *     GR303IDT = defs.IFT_GR303IDT
 *     ISUP = defs.IFT_ISUP             # <<<<<<<<<<<<<<
 *     PROPDOCSWIRELESSMACLAYER = defs.IFT_PROPDOCSWIRELESSMACLAYER
 *     PROPDOCSWIRELESSDOWNSTREAM = defs.IFT_PROPDOCSWIRELESSDOWNSTREAM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ISUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ISUP, __pyx_t_4) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":343
 *     GR303IDT = defs.IFT_GR303IDT
 *     ISUP = defs.IFT_ISUP
 *     PROPDOCSWIRELESSMACLAYER = defs.IFT_PROPDOCSWIRELESSMACLAYER             # <<<<<<<<<<<<<<
 *     PROPDOCSWIRELESSDOWNSTREAM = defs.IFT_PROPDOCSWIRELESSDOWNSTREAM
 *     PROPDOCSWIRELESSUPSTREAM = defs.IFT_PROPDOCSWIRELESSUPSTREAM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPDOCSWIRELESSMACLAYER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPDOCSWIRELESSMACLAYER, __pyx_t_4) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":344
 *     ISUP = defs.IFT_ISUP
 *     PROPDOCSWIRELESSMACLAYER = defs.IFT_PROPDOCSWIRELESSMACLAYER
 *     PROPDOCSWIRELESSDOWNSTREAM = defs.IFT_PROPDOCSWIRELESSDOWNSTREAM             # <<<<<<<<<<<<<<
 *     PROPDOCSWIRELESSUPSTREAM = defs.IFT_PROPDOCSWIRELESSUPSTREAM
 *     HIPERLAN2 = defs.IFT_HIPERLAN2
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPDOCSWIRELESSDOWNSTREAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPDOCSWIRELESSDOWNSTREAM, __pyx_t_4) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":345
 *     PROPDOCSWIRELESSMACLAYER = defs.IFT_PROPDOCSWIRELESSMACLAYER
 *     PROPDOCSWIRELESSDOWNSTREAM = defs.IFT_PROPDOCSWIRELESSDOWNSTREAM
 *     PROPDOCSWIRELESSUPSTREAM = defs.IFT_PROPDOCSWIRELESSUPSTREAM             # <<<<<<<<<<<<<<
 *     HIPERLAN2 = defs.IFT_HIPERLAN2
 *     PROPBWAP2MP = defs.IFT_PROPBWAP2MP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPDOCSWIRELESSUPSTREAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPDOCSWIRELESSUPSTREAM, __pyx_t_4) < 0) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":346
 *     PROPDOCSWIRELESSDOWNSTREAM = defs.IFT_PROPDOCSWIRELESSDOWNSTREAM
 *     PROPDOCSWIRELESSUPSTREAM = defs.IFT_PROPDOCSWIRELESSUPSTREAM
 *     HIPERLAN2 = defs.IFT_HIPERLAN2             # <<<<<<<<<<<<<<
 *     PROPBWAP2MP = defs.IFT_PROPBWAP2MP
 *     SONETOVERHEADCHANNEL = defs.IFT_SONETOVERHEADCHANNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_HIPERLAN2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HIPERLAN2, __pyx_t_4) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":347
 *     PROPDOCSWIRELESSUPSTREAM = defs.IFT_PROPDOCSWIRELESSUPSTREAM
 *     HIPERLAN2 = defs.IFT_HIPERLAN2
 *     PROPBWAP2MP = defs.IFT_PROPBWAP2MP             # <<<<<<<<<<<<<<
 *     SONETOVERHEADCHANNEL = defs.IFT_SONETOVERHEADCHANNEL
 *     DIGITALWRAPPEROVERHEADCHANNEL = defs.IFT_DIGITALWRAPPEROVERHEADCHANNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PROPBWAP2MP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PROPBWAP2MP, __pyx_t_4) < 0) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":348
 *     HIPERLAN2 = defs.IFT_HIPERLAN2
 *     PROPBWAP2MP = defs.IFT_PROPBWAP2MP
 *     SONETOVERHEADCHANNEL = defs.IFT_SONETOVERHEADCHANNEL             # <<<<<<<<<<<<<<
 *     DIGITALWRAPPEROVERHEADCHANNEL = defs.IFT_DIGITALWRAPPEROVERHEADCHANNEL
 *     AAL2 = defs.IFT_AAL2
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_SONETOVERHEADCHANNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SONETOVERHEADCHANNEL, __pyx_t_4) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":349
 *     PROPBWAP2MP = defs.IFT_PROPBWAP2MP
 *     SONETOVERHEADCHANNEL = defs.IFT_SONETOVERHEADCHANNEL
 *     DIGITALWRAPPEROVERHEADCHANNEL = defs.IFT_DIGITALWRAPPEROVERHEADCHANNEL             # <<<<<<<<<<<<<<
 *     AAL2 = defs.IFT_AAL2
 *     RADIOMAC = defs.IFT_RADIOMAC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_DIGITALWRAPPEROVERHEADCHANNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DIGITALWRAPPEROVERHEADCHANNEL, __pyx_t_4) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":350
 *     SONETOVERHEADCHANNEL = defs.IFT_SONETOVERHEADCHANNEL
 *     DIGITALWRAPPEROVERHEADCHANNEL = defs.IFT_DIGITALWRAPPEROVERHEADCHANNEL
 *     AAL2 = defs.IFT_AAL2             # <<<<<<<<<<<<<<
 *     RADIOMAC = defs.IFT_RADIOMAC
 *     ATMRADIO = defs.IFT_ATMRADIO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_AAL2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AAL2, __pyx_t_4) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":351
 *     DIGITALWRAPPEROVERHEADCHANNEL = defs.IFT_DIGITALWRAPPEROVERHEADCHANNEL
 *     AAL2 = defs.IFT_AAL2
 *     RADIOMAC = defs.IFT_RADIOMAC             # <<<<<<<<<<<<<<
 *     ATMRADIO = defs.IFT_ATMRADIO
 *     IMT = defs.IFT_IMT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_RADIOMAC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RADIOMAC, __pyx_t_4) < 0) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":352
 *     AAL2 = defs.IFT_AAL2
 *     RADIOMAC = defs.IFT_RADIOMAC
 *     ATMRADIO = defs.IFT_ATMRADIO             # <<<<<<<<<<<<<<
 *     IMT = defs.IFT_IMT
 *     MVL = defs.IFT_MVL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMRADIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMRADIO, __pyx_t_4) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":353
 *     RADIOMAC = defs.IFT_RADIOMAC
 *     ATMRADIO = defs.IFT_ATMRADIO
 *     IMT = defs.IFT_IMT             # <<<<<<<<<<<<<<
 *     MVL = defs.IFT_MVL
 *     REACHDSL = defs.IFT_REACHDSL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_IMT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IMT, __pyx_t_4) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":354
 *     ATMRADIO = defs.IFT_ATMRADIO
 *     IMT = defs.IFT_IMT
 *     MVL = defs.IFT_MVL             # <<<<<<<<<<<<<<
 *     REACHDSL = defs.IFT_REACHDSL
 *     FRDLCIENDPT = defs.IFT_FRDLCIENDPT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_MVL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MVL, __pyx_t_4) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":355
 *     IMT = defs.IFT_IMT
 *     MVL = defs.IFT_MVL
 *     REACHDSL = defs.IFT_REACHDSL             # <<<<<<<<<<<<<<
 *     FRDLCIENDPT = defs.IFT_FRDLCIENDPT
 *     ATMVCIENDPT = defs.IFT_ATMVCIENDPT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_REACHDSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_REACHDSL, __pyx_t_4) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":356
 *     MVL = defs.IFT_MVL
 *     REACHDSL = defs.IFT_REACHDSL
 *     FRDLCIENDPT = defs.IFT_FRDLCIENDPT             # <<<<<<<<<<<<<<
 *     ATMVCIENDPT = defs.IFT_ATMVCIENDPT
 *     OPTICALCHANNEL = defs.IFT_OPTICALCHANNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_FRDLCIENDPT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FRDLCIENDPT, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":357
 *     REACHDSL = defs.IFT_REACHDSL
 *     FRDLCIENDPT = defs.IFT_FRDLCIENDPT
 *     ATMVCIENDPT = defs.IFT_ATMVCIENDPT             # <<<<<<<<<<<<<<
 *     OPTICALCHANNEL = defs.IFT_OPTICALCHANNEL
 *     OPTICALTRANSPORT = defs.IFT_OPTICALTRANSPORT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ATMVCIENDPT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ATMVCIENDPT, __pyx_t_4) < 0) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":358
 *     FRDLCIENDPT = defs.IFT_FRDLCIENDPT
 *     ATMVCIENDPT = defs.IFT_ATMVCIENDPT
 *     OPTICALCHANNEL = defs.IFT_OPTICALCHANNEL             # <<<<<<<<<<<<<<
 *     OPTICALTRANSPORT = defs.IFT_OPTICALTRANSPORT
 *     INFINIBAND = defs.IFT_INFINIBAND
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_OPTICALCHANNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_OPTICALCHANNEL, __pyx_t_4) < 0) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":359
 *     ATMVCIENDPT = defs.IFT_ATMVCIENDPT
 *     OPTICALCHANNEL = defs.IFT_OPTICALCHANNEL
 *     OPTICALTRANSPORT = defs.IFT_OPTICALTRANSPORT             # <<<<<<<<<<<<<<
 *     INFINIBAND = defs.IFT_INFINIBAND
 *     BRIDGE = defs.IFT_BRIDGE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_OPTICALTRANSPORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_OPTICALTRANSPORT, __pyx_t_4) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":360
 *     OPTICALCHANNEL = defs.IFT_OPTICALCHANNEL
 *     OPTICALTRANSPORT = defs.IFT_OPTICALTRANSPORT
 *     INFINIBAND = defs.IFT_INFINIBAND             # <<<<<<<<<<<<<<
 *     BRIDGE = defs.IFT_BRIDGE
 *     STF = defs.IFT_STF
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_INFINIBAND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INFINIBAND, __pyx_t_4) < 0) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":361
 *     OPTICALTRANSPORT = defs.IFT_OPTICALTRANSPORT
 *     INFINIBAND = defs.IFT_INFINIBAND
 *     BRIDGE = defs.IFT_BRIDGE             # <<<<<<<<<<<<<<
 *     STF = defs.IFT_STF
 *     GIF = defs.IFT_GIF
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_BRIDGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BRIDGE, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":362
 *     INFINIBAND = defs.IFT_INFINIBAND
 *     BRIDGE = defs.IFT_BRIDGE
 *     STF = defs.IFT_STF             # <<<<<<<<<<<<<<
 *     GIF = defs.IFT_GIF
 *     PVC = defs.IFT_PVC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_STF); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STF, __pyx_t_4) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":363
 *     BRIDGE = defs.IFT_BRIDGE
 *     STF = defs.IFT_STF
 *     GIF = defs.IFT_GIF             # <<<<<<<<<<<<<<
 *     PVC = defs.IFT_PVC
 *     ENC = defs.IFT_ENC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_GIF); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_GIF, __pyx_t_4) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":364
 *     STF = defs.IFT_STF
 *     GIF = defs.IFT_GIF
 *     PVC = defs.IFT_PVC             # <<<<<<<<<<<<<<
 *     ENC = defs.IFT_ENC
 *     PFLOG = defs.IFT_PFLOG
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PVC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PVC, __pyx_t_4) < 0) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":365
 *     GIF = defs.IFT_GIF
 *     PVC = defs.IFT_PVC
 *     ENC = defs.IFT_ENC             # <<<<<<<<<<<<<<
 *     PFLOG = defs.IFT_PFLOG
 *     PFSYNC = defs.IFT_PFSYNC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_ENC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ENC, __pyx_t_4) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":366
 *     PVC = defs.IFT_PVC
 *     ENC = defs.IFT_ENC
 *     PFLOG = defs.IFT_PFLOG             # <<<<<<<<<<<<<<
 *     PFSYNC = defs.IFT_PFSYNC
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PFLOG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PFLOG, __pyx_t_4) < 0) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":367
 *     ENC = defs.IFT_ENC
 *     PFLOG = defs.IFT_PFLOG
 *     PFSYNC = defs.IFT_PFSYNC             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFT_PFSYNC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PFSYNC, __pyx_t_4) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":163
 * 
 * 
 * class InterfaceType(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     OTHER = defs.IFT_OTHER
 *     I1822 = defs.IFT_1822
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceType, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceType, __pyx_t_4) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":370
 * 
 * 
 * class InterfaceLinkState(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     LINK_STATE_UNKNOWN = defs.LINK_STATE_UNKNOWN
 *     LINK_STATE_DOWN = defs.LINK_STATE_DOWN
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceLinkState, __pyx_n_s_InterfaceLinkState, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":371
 * 
 * class InterfaceLinkState(enum.IntEnum):
 *     LINK_STATE_UNKNOWN = defs.LINK_STATE_UNKNOWN             # <<<<<<<<<<<<<<
 *     LINK_STATE_DOWN = defs.LINK_STATE_DOWN
 *     LINK_STATE_UP = defs.LINK_STATE_UP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LINK_STATE_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK_STATE_UNKNOWN, __pyx_t_4) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":372
 * class InterfaceLinkState(enum.IntEnum):
 *     LINK_STATE_UNKNOWN = defs.LINK_STATE_UNKNOWN
 *     LINK_STATE_DOWN = defs.LINK_STATE_DOWN             # <<<<<<<<<<<<<<
 *     LINK_STATE_UP = defs.LINK_STATE_UP
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LINK_STATE_DOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK_STATE_DOWN, __pyx_t_4) < 0) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":373
 *     LINK_STATE_UNKNOWN = defs.LINK_STATE_UNKNOWN
 *     LINK_STATE_DOWN = defs.LINK_STATE_DOWN
 *     LINK_STATE_UP = defs.LINK_STATE_UP             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LINK_STATE_UP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINK_STATE_UP, __pyx_t_4) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":370
 * 
 * 
 * class InterfaceLinkState(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     LINK_STATE_UNKNOWN = defs.LINK_STATE_UNKNOWN
 *     LINK_STATE_DOWN = defs.LINK_STATE_DOWN
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceLinkState, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceLinkState, __pyx_t_4) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":376
 * 
 * 
 * class InterfaceMediaOption(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     AUTO = defs.IFM_AUTO
 *     MANUAL = defs.IFM_MANUAL
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceMediaOption, __pyx_n_s_InterfaceMediaOption, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":377
 * 
 * class InterfaceMediaOption(enum.IntEnum):
 *     AUTO = defs.IFM_AUTO             # <<<<<<<<<<<<<<
 *     MANUAL = defs.IFM_MANUAL
 *     NONE = defs.IFM_NONE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_AUTO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AUTO, __pyx_t_4) < 0) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":378
 * class InterfaceMediaOption(enum.IntEnum):
 *     AUTO = defs.IFM_AUTO
 *     MANUAL = defs.IFM_MANUAL             # <<<<<<<<<<<<<<
 *     NONE = defs.IFM_NONE
 *     FDX = defs.IFM_FDX
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_MANUAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MANUAL, __pyx_t_4) < 0) __PYX_ERR(0, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":379
 *     AUTO = defs.IFM_AUTO
 *     MANUAL = defs.IFM_MANUAL
 *     NONE = defs.IFM_NONE             # <<<<<<<<<<<<<<
 *     FDX = defs.IFM_FDX
 *     HDX = defs.IFM_HDX
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_NONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NONE, __pyx_t_4) < 0) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":380
 *     MANUAL = defs.IFM_MANUAL
 *     NONE = defs.IFM_NONE
 *     FDX = defs.IFM_FDX             # <<<<<<<<<<<<<<
 *     HDX = defs.IFM_HDX
 *     FLOW = defs.IFM_FLOW
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_FDX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FDX, __pyx_t_4) < 0) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":381
 *     NONE = defs.IFM_NONE
 *     FDX = defs.IFM_FDX
 *     HDX = defs.IFM_HDX             # <<<<<<<<<<<<<<
 *     FLOW = defs.IFM_FLOW
 *     FLAG0 = defs.IFM_FLAG0
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_HDX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HDX, __pyx_t_4) < 0) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":382
 *     FDX = defs.IFM_FDX
 *     HDX = defs.IFM_HDX
 *     FLOW = defs.IFM_FLOW             # <<<<<<<<<<<<<<
 *     FLAG0 = defs.IFM_FLAG0
 *     FLAG1 = defs.IFM_FLAG1
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_FLOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FLOW, __pyx_t_4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":383
 *     HDX = defs.IFM_HDX
 *     FLOW = defs.IFM_FLOW
 *     FLAG0 = defs.IFM_FLAG0             # <<<<<<<<<<<<<<
 *     FLAG1 = defs.IFM_FLAG1
 *     FLAG2 = defs.IFM_FLAG2
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_FLAG0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FLAG0, __pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":384
 *     FLOW = defs.IFM_FLOW
 *     FLAG0 = defs.IFM_FLAG0
 *     FLAG1 = defs.IFM_FLAG1             # <<<<<<<<<<<<<<
 *     FLAG2 = defs.IFM_FLAG2
 *     LOOP = defs.IFM_LOOP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_FLAG1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FLAG1, __pyx_t_4) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":385
 *     FLAG0 = defs.IFM_FLAG0
 *     FLAG1 = defs.IFM_FLAG1
 *     FLAG2 = defs.IFM_FLAG2             # <<<<<<<<<<<<<<
 *     LOOP = defs.IFM_LOOP
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_FLAG2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FLAG2, __pyx_t_4) < 0) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":386
 *     FLAG1 = defs.IFM_FLAG1
 *     FLAG2 = defs.IFM_FLAG2
 *     LOOP = defs.IFM_LOOP             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFM_LOOP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOOP, __pyx_t_4) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":376
 * 
 * 
 * class InterfaceMediaOption(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     AUTO = defs.IFM_AUTO
 *     MANUAL = defs.IFM_MANUAL
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceMediaOption, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceMediaOption, __pyx_t_4) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":389
 * 
 * 
 * class InterfaceCapability(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     RXCSUM = defs.IFCAP_RXCSUM
 *     TXCSUM = defs.IFCAP_TXCSUM
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceCapability, __pyx_n_s_InterfaceCapability, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":390
 * 
 * class InterfaceCapability(enum.IntEnum):
 *     RXCSUM = defs.IFCAP_RXCSUM             # <<<<<<<<<<<<<<
 *     TXCSUM = defs.IFCAP_TXCSUM
 *     NETCONS = defs.IFCAP_NETCONS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_RXCSUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RXCSUM, __pyx_t_4) < 0) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":391
 * class InterfaceCapability(enum.IntEnum):
 *     RXCSUM = defs.IFCAP_RXCSUM
 *     TXCSUM = defs.IFCAP_TXCSUM             # <<<<<<<<<<<<<<
 *     NETCONS = defs.IFCAP_NETCONS
 *     VLAN_MTU = defs.IFCAP_VLAN_MTU
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_TXCSUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TXCSUM, __pyx_t_4) < 0) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":392
 *     RXCSUM = defs.IFCAP_RXCSUM
 *     TXCSUM = defs.IFCAP_TXCSUM
 *     NETCONS = defs.IFCAP_NETCONS             # <<<<<<<<<<<<<<
 *     VLAN_MTU = defs.IFCAP_VLAN_MTU
 *     VLAN_HWTAGGING = defs.IFCAP_VLAN_HWTAGGING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_NETCONS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NETCONS, __pyx_t_4) < 0) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":393
 *     TXCSUM = defs.IFCAP_TXCSUM
 *     NETCONS = defs.IFCAP_NETCONS
 *     VLAN_MTU = defs.IFCAP_VLAN_MTU             # <<<<<<<<<<<<<<
 *     VLAN_HWTAGGING = defs.IFCAP_VLAN_HWTAGGING
 *     JUMBO_MTU = defs.IFCAP_JUMBO_MTU
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_VLAN_MTU); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VLAN_MTU, __pyx_t_4) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":394
 *     NETCONS = defs.IFCAP_NETCONS
 *     VLAN_MTU = defs.IFCAP_VLAN_MTU
 *     VLAN_HWTAGGING = defs.IFCAP_VLAN_HWTAGGING             # <<<<<<<<<<<<<<
 *     JUMBO_MTU = defs.IFCAP_JUMBO_MTU
 *     POLLING = defs.IFCAP_POLLING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_VLAN_HWTAGGING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VLAN_HWTAGGING, __pyx_t_4) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":395
 *     VLAN_MTU = defs.IFCAP_VLAN_MTU
 *     VLAN_HWTAGGING = defs.IFCAP_VLAN_HWTAGGING
 *     JUMBO_MTU = defs.IFCAP_JUMBO_MTU             # <<<<<<<<<<<<<<
 *     POLLING = defs.IFCAP_POLLING
 *     VLAN_HWCSUM = defs.IFCAP_VLAN_HWCSUM
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_JUMBO_MTU); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_JUMBO_MTU, __pyx_t_4) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":396
 *     VLAN_HWTAGGING = defs.IFCAP_VLAN_HWTAGGING
 *     JUMBO_MTU = defs.IFCAP_JUMBO_MTU
 *     POLLING = defs.IFCAP_POLLING             # <<<<<<<<<<<<<<
 *     VLAN_HWCSUM = defs.IFCAP_VLAN_HWCSUM
 *     TSO4 = defs.IFCAP_TSO4
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_POLLING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_POLLING, __pyx_t_4) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":397
 *     JUMBO_MTU = defs.IFCAP_JUMBO_MTU
 *     POLLING = defs.IFCAP_POLLING
 *     VLAN_HWCSUM = defs.IFCAP_VLAN_HWCSUM             # <<<<<<<<<<<<<<
 *     TSO4 = defs.IFCAP_TSO4
 *     TSO6 = defs.IFCAP_TSO6
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_VLAN_HWCSUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VLAN_HWCSUM, __pyx_t_4) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":398
 *     POLLING = defs.IFCAP_POLLING
 *     VLAN_HWCSUM = defs.IFCAP_VLAN_HWCSUM
 *     TSO4 = defs.IFCAP_TSO4             # <<<<<<<<<<<<<<
 *     TSO6 = defs.IFCAP_TSO6
 *     LRO = defs.IFCAP_LRO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_TSO4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TSO4, __pyx_t_4) < 0) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":399
 *     VLAN_HWCSUM = defs.IFCAP_VLAN_HWCSUM
 *     TSO4 = defs.IFCAP_TSO4
 *     TSO6 = defs.IFCAP_TSO6             # <<<<<<<<<<<<<<
 *     LRO = defs.IFCAP_LRO
 *     WOL_UCAST = defs.IFCAP_WOL_UCAST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_TSO6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TSO6, __pyx_t_4) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":400
 *     TSO4 = defs.IFCAP_TSO4
 *     TSO6 = defs.IFCAP_TSO6
 *     LRO = defs.IFCAP_LRO             # <<<<<<<<<<<<<<
 *     WOL_UCAST = defs.IFCAP_WOL_UCAST
 *     WOL_MCAST = defs.IFCAP_WOL_MCAST
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_LRO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LRO, __pyx_t_4) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":401
 *     TSO6 = defs.IFCAP_TSO6
 *     LRO = defs.IFCAP_LRO
 *     WOL_UCAST = defs.IFCAP_WOL_UCAST             # <<<<<<<<<<<<<<
 *     WOL_MCAST = defs.IFCAP_WOL_MCAST
 *     WOL_MAGIC = defs.IFCAP_WOL_MAGIC
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_WOL_UCAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_WOL_UCAST, __pyx_t_4) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":402
 *     LRO = defs.IFCAP_LRO
 *     WOL_UCAST = defs.IFCAP_WOL_UCAST
 *     WOL_MCAST = defs.IFCAP_WOL_MCAST             # <<<<<<<<<<<<<<
 *     WOL_MAGIC = defs.IFCAP_WOL_MAGIC
 *     TOE4 = defs.IFCAP_TOE4
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_WOL_MCAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_WOL_MCAST, __pyx_t_4) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":403
 *     WOL_UCAST = defs.IFCAP_WOL_UCAST
 *     WOL_MCAST = defs.IFCAP_WOL_MCAST
 *     WOL_MAGIC = defs.IFCAP_WOL_MAGIC             # <<<<<<<<<<<<<<
 *     TOE4 = defs.IFCAP_TOE4
 *     TOE6 = defs.IFCAP_TOE6
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_WOL_MAGIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_WOL_MAGIC, __pyx_t_4) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":404
 *     WOL_MCAST = defs.IFCAP_WOL_MCAST
 *     WOL_MAGIC = defs.IFCAP_WOL_MAGIC
 *     TOE4 = defs.IFCAP_TOE4             # <<<<<<<<<<<<<<
 *     TOE6 = defs.IFCAP_TOE6
 *     VLAN_HWFILTER = defs.IFCAP_VLAN_HWFILTER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_TOE4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TOE4, __pyx_t_4) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":405
 *     WOL_MAGIC = defs.IFCAP_WOL_MAGIC
 *     TOE4 = defs.IFCAP_TOE4
 *     TOE6 = defs.IFCAP_TOE6             # <<<<<<<<<<<<<<
 *     VLAN_HWFILTER = defs.IFCAP_VLAN_HWFILTER
 *     POLLING_NOCOUNT = defs.IFCAP_POLLING_NOCOUNT
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_TOE6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TOE6, __pyx_t_4) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":406
 *     TOE4 = defs.IFCAP_TOE4
 *     TOE6 = defs.IFCAP_TOE6
 *     VLAN_HWFILTER = defs.IFCAP_VLAN_HWFILTER             # <<<<<<<<<<<<<<
 *     POLLING_NOCOUNT = defs.IFCAP_POLLING_NOCOUNT
 *     VLAN_HWTSO = defs.IFCAP_VLAN_HWTSO
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_VLAN_HWFILTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VLAN_HWFILTER, __pyx_t_4) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":407
 *     TOE6 = defs.IFCAP_TOE6
 *     VLAN_HWFILTER = defs.IFCAP_VLAN_HWFILTER
 *     POLLING_NOCOUNT = defs.IFCAP_POLLING_NOCOUNT             # <<<<<<<<<<<<<<
 *     VLAN_HWTSO = defs.IFCAP_VLAN_HWTSO
 *     LINKSTATE = defs.IFCAP_LINKSTATE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_POLLING_NOCOUNT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_POLLING_NOCOUNT, __pyx_t_4) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":408
 *     VLAN_HWFILTER = defs.IFCAP_VLAN_HWFILTER
 *     POLLING_NOCOUNT = defs.IFCAP_POLLING_NOCOUNT
 *     VLAN_HWTSO = defs.IFCAP_VLAN_HWTSO             # <<<<<<<<<<<<<<
 *     LINKSTATE = defs.IFCAP_LINKSTATE
 *     NETMAP = defs.IFCAP_NETMAP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_VLAN_HWTSO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_VLAN_HWTSO, __pyx_t_4) < 0) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":409
 *     POLLING_NOCOUNT = defs.IFCAP_POLLING_NOCOUNT
 *     VLAN_HWTSO = defs.IFCAP_VLAN_HWTSO
 *     LINKSTATE = defs.IFCAP_LINKSTATE             # <<<<<<<<<<<<<<
 *     NETMAP = defs.IFCAP_NETMAP
 *     RXCSUM_IPV6 = defs.IFCAP_RXCSUM_IPV6
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_LINKSTATE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LINKSTATE, __pyx_t_4) < 0) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":410
 *     VLAN_HWTSO = defs.IFCAP_VLAN_HWTSO
 *     LINKSTATE = defs.IFCAP_LINKSTATE
 *     NETMAP = defs.IFCAP_NETMAP             # <<<<<<<<<<<<<<
 *     RXCSUM_IPV6 = defs.IFCAP_RXCSUM_IPV6
 *     TXCSUM_IPV6 = defs.IFCAP_TXCSUM_IPV6
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_NETMAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NETMAP, __pyx_t_4) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":411
 *     LINKSTATE = defs.IFCAP_LINKSTATE
 *     NETMAP = defs.IFCAP_NETMAP
 *     RXCSUM_IPV6 = defs.IFCAP_RXCSUM_IPV6             # <<<<<<<<<<<<<<
 *     TXCSUM_IPV6 = defs.IFCAP_TXCSUM_IPV6
 *     HWSTATS = defs.IFCAP_HWSTATS
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_RXCSUM_IPV6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RXCSUM_IPV6, __pyx_t_4) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":412
 *     NETMAP = defs.IFCAP_NETMAP
 *     RXCSUM_IPV6 = defs.IFCAP_RXCSUM_IPV6
 *     TXCSUM_IPV6 = defs.IFCAP_TXCSUM_IPV6             # <<<<<<<<<<<<<<
 *     HWSTATS = defs.IFCAP_HWSTATS
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_TXCSUM_IPV6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TXCSUM_IPV6, __pyx_t_4) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":413
 *     RXCSUM_IPV6 = defs.IFCAP_RXCSUM_IPV6
 *     TXCSUM_IPV6 = defs.IFCAP_TXCSUM_IPV6
 *     HWSTATS = defs.IFCAP_HWSTATS             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFCAP_HWSTATS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_HWSTATS, __pyx_t_4) < 0) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":389
 * 
 * 
 * class InterfaceCapability(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     RXCSUM = defs.IFCAP_RXCSUM
 *     TXCSUM = defs.IFCAP_TXCSUM
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceCapability, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceCapability, __pyx_t_4) < 0) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":416
 * 
 * 
 * class InterfaceAnnounceType(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     ARRIVAL = defs.IFAN_ARRIVAL
 *     DEPARTURE = defs.IFAN_DEPARTURE
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceAnnounceType, __pyx_n_s_InterfaceAnnounceType, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":417
 * 
 * class InterfaceAnnounceType(enum.IntEnum):
 *     ARRIVAL = defs.IFAN_ARRIVAL             # <<<<<<<<<<<<<<
 *     DEPARTURE = defs.IFAN_DEPARTURE
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFAN_ARRIVAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ARRIVAL, __pyx_t_4) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":418
 * class InterfaceAnnounceType(enum.IntEnum):
 *     ARRIVAL = defs.IFAN_ARRIVAL
 *     DEPARTURE = defs.IFAN_DEPARTURE             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IFAN_DEPARTURE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DEPARTURE, __pyx_t_4) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":416
 * 
 * 
 * class InterfaceAnnounceType(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     ARRIVAL = defs.IFAN_ARRIVAL
 *     DEPARTURE = defs.IFAN_DEPARTURE
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceAnnounceType, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceAnnounceType, __pyx_t_4) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":421
 * 
 * 
 * class AggregationProtocol(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     NONE = defs.LAGG_PROTO_NONE
 *     ROUNDROBIN = defs.LAGG_PROTO_ROUNDROBIN
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_AggregationProtocol, __pyx_n_s_AggregationProtocol, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":422
 * 
 * class AggregationProtocol(enum.IntEnum):
 *     NONE = defs.LAGG_PROTO_NONE             # <<<<<<<<<<<<<<
 *     ROUNDROBIN = defs.LAGG_PROTO_ROUNDROBIN
 *     FAILOVER = defs.LAGG_PROTO_FAILOVER
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PROTO_NONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NONE, __pyx_t_4) < 0) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":423
 * class AggregationProtocol(enum.IntEnum):
 *     NONE = defs.LAGG_PROTO_NONE
 *     ROUNDROBIN = defs.LAGG_PROTO_ROUNDROBIN             # <<<<<<<<<<<<<<
 *     FAILOVER = defs.LAGG_PROTO_FAILOVER
 *     LOADBALANCE = defs.LAGG_PROTO_LOADBALANCE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PROTO_ROUNDROBIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ROUNDROBIN, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":424
 *     NONE = defs.LAGG_PROTO_NONE
 *     ROUNDROBIN = defs.LAGG_PROTO_ROUNDROBIN
 *     FAILOVER = defs.LAGG_PROTO_FAILOVER             # <<<<<<<<<<<<<<
 *     LOADBALANCE = defs.LAGG_PROTO_LOADBALANCE
 *     LACP = defs.LAGG_PROTO_LACP
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PROTO_FAILOVER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_FAILOVER, __pyx_t_4) < 0) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":425
 *     ROUNDROBIN = defs.LAGG_PROTO_ROUNDROBIN
 *     FAILOVER = defs.LAGG_PROTO_FAILOVER
 *     LOADBALANCE = defs.LAGG_PROTO_LOADBALANCE             # <<<<<<<<<<<<<<
 *     LACP = defs.LAGG_PROTO_LACP
 *     IF FREEBSD_VERSION < 1100079:
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PROTO_LOADBALANCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LOADBALANCE, __pyx_t_4) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":426
 *     FAILOVER = defs.LAGG_PROTO_FAILOVER
 *     LOADBALANCE = defs.LAGG_PROTO_LOADBALANCE
 *     LACP = defs.LAGG_PROTO_LACP             # <<<<<<<<<<<<<<
 *     IF FREEBSD_VERSION < 1100079:
 *         ETHERCHANNEL = defs.LAGG_PROTO_ETHERCHANNEL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PROTO_LACP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_LACP, __pyx_t_4) < 0) __PYX_ERR(0, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":428
 *     LACP = defs.LAGG_PROTO_LACP
 *     IF FREEBSD_VERSION < 1100079:
 *         ETHERCHANNEL = defs.LAGG_PROTO_ETHERCHANNEL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PROTO_ETHERCHANNEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ETHERCHANNEL, __pyx_t_4) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":421
 * 
 * 
 * class AggregationProtocol(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     NONE = defs.LAGG_PROTO_NONE
 *     ROUNDROBIN = defs.LAGG_PROTO_ROUNDROBIN
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_AggregationProtocol, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AggregationProtocol, __pyx_t_4) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":431
 * 
 * 
 * class LaggPortFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     SLAVE = defs.LAGG_PORT_SLAVE
 *     MASTER = defs.LAGG_PORT_MASTER
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_LaggPortFlags, __pyx_n_s_LaggPortFlags, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":432
 * 
 * class LaggPortFlags(enum.IntEnum):
 *     SLAVE = defs.LAGG_PORT_SLAVE             # <<<<<<<<<<<<<<
 *     MASTER = defs.LAGG_PORT_MASTER
 *     STACK = defs.LAGG_PORT_STACK
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_SLAVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SLAVE, __pyx_t_4) < 0) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":433
 * class LaggPortFlags(enum.IntEnum):
 *     SLAVE = defs.LAGG_PORT_SLAVE
 *     MASTER = defs.LAGG_PORT_MASTER             # <<<<<<<<<<<<<<
 *     STACK = defs.LAGG_PORT_STACK
 *     ACTIVE = defs.LAGG_PORT_ACTIVE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_MASTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MASTER, __pyx_t_4) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":434
 *     SLAVE = defs.LAGG_PORT_SLAVE
 *     MASTER = defs.LAGG_PORT_MASTER
 *     STACK = defs.LAGG_PORT_STACK             # <<<<<<<<<<<<<<
 *     ACTIVE = defs.LAGG_PORT_ACTIVE
 *     COLLECTING = defs.LAGG_PORT_COLLECTING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_STACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_STACK, __pyx_t_4) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":435
 *     MASTER = defs.LAGG_PORT_MASTER
 *     STACK = defs.LAGG_PORT_STACK
 *     ACTIVE = defs.LAGG_PORT_ACTIVE             # <<<<<<<<<<<<<<
 *     COLLECTING = defs.LAGG_PORT_COLLECTING
 *     DISTRIBUTING = defs.LAGG_PORT_DISTRIBUTING
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_ACTIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ACTIVE, __pyx_t_4) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":436
 *     STACK = defs.LAGG_PORT_STACK
 *     ACTIVE = defs.LAGG_PORT_ACTIVE
 *     COLLECTING = defs.LAGG_PORT_COLLECTING             # <<<<<<<<<<<<<<
 *     DISTRIBUTING = defs.LAGG_PORT_DISTRIBUTING
 *     DISABLED = defs.LAGG_PORT_DISABLED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_COLLECTING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_COLLECTING, __pyx_t_4) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":437
 *     ACTIVE = defs.LAGG_PORT_ACTIVE
 *     COLLECTING = defs.LAGG_PORT_COLLECTING
 *     DISTRIBUTING = defs.LAGG_PORT_DISTRIBUTING             # <<<<<<<<<<<<<<
 *     DISABLED = defs.LAGG_PORT_DISABLED
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_DISTRIBUTING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DISTRIBUTING, __pyx_t_4) < 0) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":438
 *     COLLECTING = defs.LAGG_PORT_COLLECTING
 *     DISTRIBUTING = defs.LAGG_PORT_DISTRIBUTING
 *     DISABLED = defs.LAGG_PORT_DISABLED             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(LAGG_PORT_DISABLED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DISABLED, __pyx_t_4) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":431
 * 
 * 
 * class LaggPortFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     SLAVE = defs.LAGG_PORT_SLAVE
 *     MASTER = defs.LAGG_PORT_MASTER
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LaggPortFlags, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LaggPortFlags, __pyx_t_4) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":441
 * 
 * 
 * class NeighborDiscoveryFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     PERFORMNUD = defs.ND6_IFF_PERFORMNUD
 *     ACCEPT_RTADV = defs.ND6_IFF_ACCEPT_RTADV
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_NeighborDiscoveryFlags, __pyx_n_s_NeighborDiscoveryFlags, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":442
 * 
 * class NeighborDiscoveryFlags(enum.IntEnum):
 *     PERFORMNUD = defs.ND6_IFF_PERFORMNUD             # <<<<<<<<<<<<<<
 *     ACCEPT_RTADV = defs.ND6_IFF_ACCEPT_RTADV
 *     PREFER_SOURCE = defs.ND6_IFF_PREFER_SOURCE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_PERFORMNUD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PERFORMNUD, __pyx_t_4) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":443
 * class NeighborDiscoveryFlags(enum.IntEnum):
 *     PERFORMNUD = defs.ND6_IFF_PERFORMNUD
 *     ACCEPT_RTADV = defs.ND6_IFF_ACCEPT_RTADV             # <<<<<<<<<<<<<<
 *     PREFER_SOURCE = defs.ND6_IFF_PREFER_SOURCE
 *     IFDISABLED = defs.ND6_IFF_IFDISABLED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_ACCEPT_RTADV); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ACCEPT_RTADV, __pyx_t_4) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":444
 *     PERFORMNUD = defs.ND6_IFF_PERFORMNUD
 *     ACCEPT_RTADV = defs.ND6_IFF_ACCEPT_RTADV
 *     PREFER_SOURCE = defs.ND6_IFF_PREFER_SOURCE             # <<<<<<<<<<<<<<
 *     IFDISABLED = defs.ND6_IFF_IFDISABLED
 *     DONT_SET_IFROUTE = defs.ND6_IFF_DONT_SET_IFROUTE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_PREFER_SOURCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PREFER_SOURCE, __pyx_t_4) < 0) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":445
 *     ACCEPT_RTADV = defs.ND6_IFF_ACCEPT_RTADV
 *     PREFER_SOURCE = defs.ND6_IFF_PREFER_SOURCE
 *     IFDISABLED = defs.ND6_IFF_IFDISABLED             # <<<<<<<<<<<<<<
 *     DONT_SET_IFROUTE = defs.ND6_IFF_DONT_SET_IFROUTE
 *     AUTO_LINKLOCAL = defs.ND6_IFF_AUTO_LINKLOCAL
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_IFDISABLED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_IFDISABLED, __pyx_t_4) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":446
 *     PREFER_SOURCE = defs.ND6_IFF_PREFER_SOURCE
 *     IFDISABLED = defs.ND6_IFF_IFDISABLED
 *     DONT_SET_IFROUTE = defs.ND6_IFF_DONT_SET_IFROUTE             # <<<<<<<<<<<<<<
 *     AUTO_LINKLOCAL = defs.ND6_IFF_AUTO_LINKLOCAL
 *     NO_RADR = defs.ND6_IFF_NO_RADR
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_DONT_SET_IFROUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DONT_SET_IFROUTE, __pyx_t_4) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":447
 *     IFDISABLED = defs.ND6_IFF_IFDISABLED
 *     DONT_SET_IFROUTE = defs.ND6_IFF_DONT_SET_IFROUTE
 *     AUTO_LINKLOCAL = defs.ND6_IFF_AUTO_LINKLOCAL             # <<<<<<<<<<<<<<
 *     NO_RADR = defs.ND6_IFF_NO_RADR
 *     NO_PREFER_IFACE = defs.ND6_IFF_NO_PREFER_IFACE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_AUTO_LINKLOCAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AUTO_LINKLOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":448
 *     DONT_SET_IFROUTE = defs.ND6_IFF_DONT_SET_IFROUTE
 *     AUTO_LINKLOCAL = defs.ND6_IFF_AUTO_LINKLOCAL
 *     NO_RADR = defs.ND6_IFF_NO_RADR             # <<<<<<<<<<<<<<
 *     NO_PREFER_IFACE = defs.ND6_IFF_NO_PREFER_IFACE
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_NO_RADR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NO_RADR, __pyx_t_4) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":449
 *     AUTO_LINKLOCAL = defs.ND6_IFF_AUTO_LINKLOCAL
 *     NO_RADR = defs.ND6_IFF_NO_RADR
 *     NO_PREFER_IFACE = defs.ND6_IFF_NO_PREFER_IFACE             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(ND6_IFF_NO_PREFER_IFACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_NO_PREFER_IFACE, __pyx_t_4) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":441
 * 
 * 
 * class NeighborDiscoveryFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     PERFORMNUD = defs.ND6_IFF_PERFORMNUD
 *     ACCEPT_RTADV = defs.ND6_IFF_ACCEPT_RTADV
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NeighborDiscoveryFlags, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NeighborDiscoveryFlags, __pyx_t_4) < 0) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":452
 * 
 * 
 * class In6AddrFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     ANYCAST = defs.IN6_IFF_ANYCAST
 *     TENTATIVE = defs.IN6_IFF_TENTATIVE
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_In6AddrFlags, __pyx_n_s_In6AddrFlags, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":453
 * 
 * class In6AddrFlags(enum.IntEnum):
 *     ANYCAST = defs.IN6_IFF_ANYCAST             # <<<<<<<<<<<<<<
 *     TENTATIVE = defs.IN6_IFF_TENTATIVE
 *     DUPLICATED = defs.IN6_IFF_DUPLICATED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_ANYCAST); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ANYCAST, __pyx_t_4) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":454
 * class In6AddrFlags(enum.IntEnum):
 *     ANYCAST = defs.IN6_IFF_ANYCAST
 *     TENTATIVE = defs.IN6_IFF_TENTATIVE             # <<<<<<<<<<<<<<
 *     DUPLICATED = defs.IN6_IFF_DUPLICATED
 *     DETACHED = defs.IN6_IFF_DETACHED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_TENTATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TENTATIVE, __pyx_t_4) < 0) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":455
 *     ANYCAST = defs.IN6_IFF_ANYCAST
 *     TENTATIVE = defs.IN6_IFF_TENTATIVE
 *     DUPLICATED = defs.IN6_IFF_DUPLICATED             # <<<<<<<<<<<<<<
 *     DETACHED = defs.IN6_IFF_DETACHED
 *     DEPRECATED = defs.IN6_IFF_DEPRECATED
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_DUPLICATED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DUPLICATED, __pyx_t_4) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":456
 *     TENTATIVE = defs.IN6_IFF_TENTATIVE
 *     DUPLICATED = defs.IN6_IFF_DUPLICATED
 *     DETACHED = defs.IN6_IFF_DETACHED             # <<<<<<<<<<<<<<
 *     DEPRECATED = defs.IN6_IFF_DEPRECATED
 *     AUTOCONF = defs.IN6_IFF_AUTOCONF
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_DETACHED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DETACHED, __pyx_t_4) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":457
 *     DUPLICATED = defs.IN6_IFF_DUPLICATED
 *     DETACHED = defs.IN6_IFF_DETACHED
 *     DEPRECATED = defs.IN6_IFF_DEPRECATED             # <<<<<<<<<<<<<<
 *     AUTOCONF = defs.IN6_IFF_AUTOCONF
 *     TEMPORARY = defs.IN6_IFF_TEMPORARY
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_DEPRECATED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_DEPRECATED, __pyx_t_4) < 0) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":458
 *     DETACHED = defs.IN6_IFF_DETACHED
 *     DEPRECATED = defs.IN6_IFF_DEPRECATED
 *     AUTOCONF = defs.IN6_IFF_AUTOCONF             # <<<<<<<<<<<<<<
 *     TEMPORARY = defs.IN6_IFF_TEMPORARY
 *     PREFER_SOURCE = defs.IN6_IFF_PREFER_SOURCE
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_AUTOCONF); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_AUTOCONF, __pyx_t_4) < 0) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":459
 *     DEPRECATED = defs.IN6_IFF_DEPRECATED
 *     AUTOCONF = defs.IN6_IFF_AUTOCONF
 *     TEMPORARY = defs.IN6_IFF_TEMPORARY             # <<<<<<<<<<<<<<
 *     PREFER_SOURCE = defs.IN6_IFF_PREFER_SOURCE
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_TEMPORARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_TEMPORARY, __pyx_t_4) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":460
 *     AUTOCONF = defs.IN6_IFF_AUTOCONF
 *     TEMPORARY = defs.IN6_IFF_TEMPORARY
 *     PREFER_SOURCE = defs.IN6_IFF_PREFER_SOURCE             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(IN6_IFF_PREFER_SOURCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_PREFER_SOURCE, __pyx_t_4) < 0) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":452
 * 
 * 
 * class In6AddrFlags(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     ANYCAST = defs.IN6_IFF_ANYCAST
 *     TENTATIVE = defs.IN6_IFF_TENTATIVE
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_In6AddrFlags, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_In6AddrFlags, __pyx_t_4) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":463
 * 
 * 
 * class CarpState(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     INIT = 0
 *     BACKUP = 1
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CarpState, __pyx_n_s_CarpState, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":464
 * 
 * class CarpState(enum.IntEnum):
 *     INIT = 0             # <<<<<<<<<<<<<<
 *     BACKUP = 1
 *     MASTER = 2
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_INIT, __pyx_int_0) < 0) __PYX_ERR(0, 464, __pyx_L1_error)

  /* "netif.pyx":465
 * class CarpState(enum.IntEnum):
 *     INIT = 0
 *     BACKUP = 1             # <<<<<<<<<<<<<<
 *     MASTER = 2
 * 
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_BACKUP, __pyx_int_1) < 0) __PYX_ERR(0, 465, __pyx_L1_error)

  /* "netif.pyx":466
 *     INIT = 0
 *     BACKUP = 1
 *     MASTER = 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_MASTER, __pyx_int_2) < 0) __PYX_ERR(0, 466, __pyx_L1_error)

  /* "netif.pyx":463
 * 
 * 
 * class CarpState(enum.IntEnum):             # <<<<<<<<<<<<<<
 *     INIT = 0
 *     BACKUP = 1
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CarpState, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CarpState, __pyx_t_4) < 0) __PYX_ERR(0, 463, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":469
 * 
 * 
 * class LinkAddress(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, ifname=None, address=None):
 *         self.ifname = ifname
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_LinkAddress, __pyx_n_s_LinkAddress, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":470
 * 
 * class LinkAddress(object):
 *     def __init__(self, ifname=None, address=None):             # <<<<<<<<<<<<<<
 *         self.ifname = ifname
 *         self.address = address
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_11LinkAddress_1__init__, 0, __pyx_n_s_LinkAddress___init, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__42);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":474
 *         self.address = address
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.address
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_11LinkAddress_3__str__, 0, __pyx_n_s_LinkAddress___str, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":477
 *         return self.address
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'ifname': self.ifname,
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_11LinkAddress_5__getstate__, 0, __pyx_n_s_LinkAddress___getstate, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getstate, __pyx_t_4) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":483
 *         }
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.ifname, self.address))
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_11LinkAddress_7__hash__, 0, __pyx_n_s_LinkAddress___hash, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_hash, __pyx_t_4) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":486
 *         return hash((self.ifname, self.address))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.ifname == other.ifname and \
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_11LinkAddress_9__eq__, 0, __pyx_n_s_LinkAddress___eq, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":491
 *             self.address == other.address
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_11LinkAddress_11__ne__, 0, __pyx_n_s_LinkAddress___ne, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":469
 * 
 * 
 * class LinkAddress(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, ifname=None, address=None):
 *         self.ifname = ifname
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LinkAddress, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinkAddress, __pyx_t_4) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":495
 * 
 * 
 * class InterfaceAddress(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, af=None, address=None):
 *         self.af = af
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterfaceAddress, __pyx_n_s_InterfaceAddress, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":496
 * 
 * class InterfaceAddress(object):
 *     def __init__(self, af=None, address=None):             # <<<<<<<<<<<<<<
 *         self.af = af
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16InterfaceAddress_1__init__, 0, __pyx_n_s_InterfaceAddress___init, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__55);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":513
 *         self.vhid = None
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16InterfaceAddress_3__str__, 0, __pyx_n_s_InterfaceAddress___str, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":516
 *         return u'{0}/{1}'.format(self.address, self.netmask)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16InterfaceAddress_5__hash__, 0, __pyx_n_s_InterfaceAddress___hash, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_hash, __pyx_t_4) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":519
 *         return hash((self.af, self.address, self.netmask, self.broadcast, self.dest_address))
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         ret = {
 *             'type': self.af.name,
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16InterfaceAddress_7__getstate__, 0, __pyx_n_s_InterfaceAddress___getstate, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getstate, __pyx_t_4) < 0) __PYX_ERR(0, 519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":534
 *         return ret
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return \
 *             self.af == other.af and \
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16InterfaceAddress_9__eq__, 0, __pyx_n_s_InterfaceAddress___eq, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":543
 *             self.vhid == other.vhid
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_16InterfaceAddress_11__ne__, 0, __pyx_n_s_InterfaceAddress___ne, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":495
 * 
 * 
 * class InterfaceAddress(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, af=None, address=None):
 *         self.af = af
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterfaceAddress, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceAddress, __pyx_t_4) < 0) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "netif.pyx":547
 * 
 * # wrap socket.socket on python2 so that we can use "with"
 * if not hasattr(socket.socket, '__enter__'):             # <<<<<<<<<<<<<<
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_enter); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
  if (__pyx_t_6) {

    /* "netif.pyx":548
 * # wrap socket.socket on python2 so that we can use "with"
 * if not hasattr(socket.socket, '__enter__'):
 *     class WrapSocket(socket.socket):             # <<<<<<<<<<<<<<
 *         def __enter__(self):
 *             return self
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_WrapSocket, __pyx_n_s_WrapSocket, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "netif.pyx":549
 * if not hasattr(socket.socket, '__enter__'):
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):             # <<<<<<<<<<<<<<
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_10WrapSocket_1__enter__, 0, __pyx_n_s_WrapSocket___enter, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_enter, __pyx_t_4) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "netif.pyx":551
 *         def __enter__(self):
 *             return self
 *         def __exit__(self, exc_type, exc_val, exc_frame):             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_10WrapSocket_3__exit__, 0, __pyx_n_s_WrapSocket___exit, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_exit, __pyx_t_4) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "netif.pyx":548
 * # wrap socket.socket on python2 so that we can use "with"
 * if not hasattr(socket.socket, '__enter__'):
 *     class WrapSocket(socket.socket):             # <<<<<<<<<<<<<<
 *         def __enter__(self):
 *             return self
 */
    __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_WrapSocket, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_WrapSocket, __pyx_t_4) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":554
 *             self.close()
 * 
 *     sock3 = WrapSocket             # <<<<<<<<<<<<<<
 * else:
 *     sock3 = socket.socket
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_WrapSocket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_sock3, __pyx_t_1) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "netif.pyx":547
 * 
 * # wrap socket.socket on python2 so that we can use "with"
 * if not hasattr(socket.socket, '__enter__'):             # <<<<<<<<<<<<<<
 *     class WrapSocket(socket.socket):
 *         def __enter__(self):
 */
    goto __pyx_L2;
  }

  /* "netif.pyx":556
 *     sock3 = WrapSocket
 * else:
 *     sock3 = socket.socket             # <<<<<<<<<<<<<<
 * 
 * cdef class NetworkInterface(object):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_sock3, __pyx_t_2) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L2:;

  /* "netif.pyx":583
 *         return True
 * 
 *     cdef int ioctl(self, uint32_t cmd, void* args, af=socket.AF_INET):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         with sock3(af, socket.SOCK_DGRAM) as s:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_k__3 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "netif.pyx":1005
 * 
 * 
 * class CarpConfig(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):
 *         self.vhid = vhid
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_CarpConfig, __pyx_n_s_CarpConfig, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1006
 * 
 * class CarpConfig(object):
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):             # <<<<<<<<<<<<<<
 *         self.vhid = vhid
 *         self.addr = addr
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_10CarpConfig_1__init__, 0, __pyx_n_s_CarpConfig___init, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__72);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1005
 * 
 * 
 * class CarpConfig(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, vhid, addr=None, advbase=None, advskew=None, key=None, state=None):
 *         self.vhid = vhid
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CarpConfig, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CarpConfig, __pyx_t_4) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1597
 * 
 * 
 * class Route(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, network, netmask, gateway=None, interface=None):
 *         self.network = ipaddress.ip_address(network)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Route, __pyx_n_s_Route, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1598
 * 
 * class Route(object):
 *     def __init__(self, network, netmask, gateway=None, interface=None):             # <<<<<<<<<<<<<<
 *         self.network = ipaddress.ip_address(network)
 *         self.netmask = None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_5Route_1__init__, 0, __pyx_n_s_Route___init, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__75);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1618
 * 
 *     @property
 *     def af(self):             # <<<<<<<<<<<<<<
 *         if not self.network:
 *             return None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_5Route_3af, 0, __pyx_n_s_Route_af, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1617
 *             self.interface = interface
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def af(self):
 *         if not self.network:
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_af, __pyx_t_4) < 0) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1630
 *         return None
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return {
 *             'network': str(self.network),
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_5Route_5__getstate__, 0, __pyx_n_s_Route___getstate, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getstate, __pyx_t_4) < 0) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1639
 *         }
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, Route):
 *             return False
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_5Route_7__eq__, 0, __pyx_n_s_Route___eq, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1647
 *             self.gateway == other.gateway
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return not self == other
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_5Route_9__ne__, 0, __pyx_n_s_Route___ne, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1650
 *         return not self == other
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((
 *             self.network,
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_5Route_11__hash__, 0, __pyx_n_s_Route___hash, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_hash, __pyx_t_4) < 0) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1597
 * 
 * 
 * class Route(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, network, netmask, gateway=None, interface=None):
 *         self.network = ipaddress.ip_address(network)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Route, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Route, __pyx_t_4) < 0) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1658
 * 
 * 
 * class RoutingTable(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         pass
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_RoutingTable, __pyx_n_s_RoutingTable, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1659
 * 
 * class RoutingTable(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_1__init__, 0, __pyx_n_s_RoutingTable___init, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1662
 *         pass
 * 
 *     def __send_message(self, msg):             # <<<<<<<<<<<<<<
 *         if msg.type == RoutingMessageType.DELETE:
 *             msg.gateway = None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_3__send_message, 0, __pyx_n_s_RoutingTable___send_message, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RoutingTable__send_message, __pyx_t_4) < 0) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1671
 *         sock.close()
 * 
 *     def __send_route(self, type, route):             # <<<<<<<<<<<<<<
 *         msg = RoutingMessage()
 *         msg.type = type
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_5__send_route, 0, __pyx_n_s_RoutingTable___send_route, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_RoutingTable__send_route, __pyx_t_4) < 0) __PYX_ERR(0, 1671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1678
 * 
 *     @property
 *     def default_route_ipv4(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 *         return f[0] if len(f) > 0 else None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_7default_route_ipv4, 0, __pyx_n_s_RoutingTable_default_route_ipv4_2, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1677
 *         self.__send_message(msg)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_route_ipv4(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET, self.routes))
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_default_route_ipv4, __pyx_t_4) < 0) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1683
 * 
 *     @property
 *     def default_route_ipv6(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 *         return f[0] if len(f) > 0 else None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_9default_route_ipv6, 0, __pyx_n_s_RoutingTable_default_route_ipv6_2, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1682
 *         return f[0] if len(f) > 0 else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_route_ipv6(self):
 *         f = list(filter(lambda r: int(r.network) == 0 and int(r.netmask) == 0 and r.af == AddressFamily.INET6, self.routes))
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_default_route_ipv6, __pyx_t_4) < 0) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1688
 * 
 *     @property
 *     def routes(self):             # <<<<<<<<<<<<<<
 *         cdef char* buf
 *         cdef defs.rt_msghdr* rt_msg
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_11routes, 0, __pyx_n_s_RoutingTable_routes, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1687
 *         return f[0] if len(f) > 0 else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def routes(self):
 *         cdef char* buf
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_routes, __pyx_t_4) < 0) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1704
 * 
 *     @property
 *     def default_route(self):             # <<<<<<<<<<<<<<
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 *         return f[0] if f else None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_14default_route, 0, __pyx_n_s_RoutingTable_default_route, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1703
 *             yield msg.route
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_route(self):
 *         f = list(filter(lambda r: r.network == ipaddress.ip_address(u'0.0.0.0'), self.routes))
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_default_route, __pyx_t_4) < 0) __PYX_ERR(0, 1704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1709
 * 
 *     @property
 *     def static_routes(self):             # <<<<<<<<<<<<<<
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_16static_routes, 0, __pyx_n_s_RoutingTable_static_routes, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "netif.pyx":1708
 *         return f[0] if f else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def static_routes(self):
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_static_routes, __pyx_t_4) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1712
 *         return list(filter(lambda r: RouteFlags.STATIC in r.flags and r.network != ipaddress.ip_address(u'0.0.0.0'), self.routes))
 * 
 *     def add(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_18add, 0, __pyx_n_s_RoutingTable_add, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add, __pyx_t_4) < 0) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1715
 *         self.__send_route(RoutingMessageType.ADD, route)
 * 
 *     def delete(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_20delete, 0, __pyx_n_s_RoutingTable_delete, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_delete, __pyx_t_4) < 0) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1718
 *         self.__send_route(RoutingMessageType.DELETE, route)
 * 
 *     def change(self, route):             # <<<<<<<<<<<<<<
 *         self.__send_route(RoutingMessageType.CHANGE, route)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_12RoutingTable_22change, 0, __pyx_n_s_RoutingTable_change, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_change, __pyx_t_4) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1658
 * 
 * 
 * class RoutingTable(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         pass
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RoutingTable, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RoutingTable, __pyx_t_4) < 0) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1722
 * 
 * 
 * class RoutingSocket(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.socket = None
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_RoutingSocket, __pyx_n_s_RoutingSocket, (PyObject *) NULL, __pyx_n_s_netif, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "netif.pyx":1723
 * 
 * class RoutingSocket(object):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.socket = None
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_13RoutingSocket_1__init__, 0, __pyx_n_s_RoutingSocket___init, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1726
 *         self.socket = None
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_13RoutingSocket_3open, 0, __pyx_n_s_RoutingSocket_open, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_open, __pyx_t_4) < 0) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1729
 *          self.socket = socket.socket(socket.AF_ROUTE, socket.SOCK_RAW, 0)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.socket.close()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_13RoutingSocket_5close, 0, __pyx_n_s_RoutingSocket_close, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_close, __pyx_t_4) < 0) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1732
 *         self.socket.close()
 * 
 *     def read_message(self):             # <<<<<<<<<<<<<<
 *         cdef char* buffer
 *         cdef defs.rt_msghdr* rt_msg
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_13RoutingSocket_7read_message, 0, __pyx_n_s_RoutingSocket_read_message, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_message, __pyx_t_4) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1755
 *         return RoutingMessage(packet)
 * 
 *     def write_message(self, message):             # <<<<<<<<<<<<<<
 *         buf = message.as_buffer()
 *         os.write(self.socket.fileno(), buf)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5netif_13RoutingSocket_9write_message, 0, __pyx_n_s_RoutingSocket_write_message, NULL, __pyx_n_s_netif, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_message, __pyx_t_4) < 0) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "netif.pyx":1722
 * 
 * 
 * class RoutingSocket(object):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.socket = None
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RoutingSocket, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RoutingSocket, __pyx_t_4) < 0) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1759
 *         os.write(self.socket.fileno(), buf)
 * 
 * def get_ifgroup(groupname):             # <<<<<<<<<<<<<<
 *     """Given group name such as vnet or bridge, get group members"""
 *     cdef defs.ifgroupreq ifgr
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_1get_ifgroup, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ifgroup, __pyx_t_1) < 0) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1914
 *     return result
 * 
 * def list_interfaces(names=None, typemap=None):             # <<<<<<<<<<<<<<
 *     """
 *     Return a dictionary of all interfaces in the system.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_3list_interfaces, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_interfaces, __pyx_t_1) < 0) __PYX_ERR(0, 1914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1948
 *         defs.freeifaddrs(ifa)
 * 
 * def bitmask_to_set(n, enumeration):             # <<<<<<<<<<<<<<
 *     result = set()
 *     while n:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_5bitmask_to_set, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bitmask_to_set, __pyx_t_1) < 0) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1962
 * 
 * 
 * def set_to_bitmask(value):             # <<<<<<<<<<<<<<
 *     result = 0
 *     for i in value:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_7set_to_bitmask, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_to_bitmask, __pyx_t_1) < 0) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1970
 * 
 * 
 * def get_interface(name, force_type=None, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Get the given interface.  Raises KeyError if interface does
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_9get_interface, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_interface, __pyx_t_1) < 0) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1996
 * 
 * 
 * def create_interface(name):             # <<<<<<<<<<<<<<
 *     """create new cloned interface (vlan, lagg, bridge)"""
 *     name = name.encode('ascii')
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_11create_interface, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_interface, __pyx_t_1) < 0) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":2007
 * 
 * 
 * def destroy_interface(name):             # <<<<<<<<<<<<<<
 *     """destroy specified interface (probably should only use on clones)"""
 *     name = name.encode('ascii')
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_13destroy_interface, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy_interface, __pyx_t_1) < 0) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":2018
 * 
 * 
 * def get_hostname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_15get_hostname, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hostname, __pyx_t_1) < 0) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":2027
 * 
 * 
 * def set_hostname(newhostname):             # <<<<<<<<<<<<<<
 *     newhostname = newhostname.encode('ascii')
 *     if defs.sethostname(newhostname, len(newhostname)) != 0:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_17set_hostname, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_hostname, __pyx_t_1) < 0) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":2033
 * 
 * 
 * def get_domainname():             # <<<<<<<<<<<<<<
 *     cdef char buf[defs._SC_HOST_NAME_MAX]
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_19get_domainname, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_domainname, __pyx_t_1) < 0) __PYX_ERR(0, 2033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":2042
 * 
 * 
 * def set_domainname(newdomainname):             # <<<<<<<<<<<<<<
 *     newdomainname = newdomainname.encode('ascii')
 *     if defs.setdomainname(newdomainname, len(newdomainname)) != 0:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5netif_21set_domainname, NULL, __pyx_n_s_netif); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_domainname, __pyx_t_1) < 0) __PYX_ERR(0, 2042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "netif.pyx":1
 * #+             # <<<<<<<<<<<<<<
 * # Copyright 2015 iXsystems, Inc.
 * # All rights reserved
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init netif", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init netif");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* PyObjectCall */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCallNoArg */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyErrFetchRestore */
      #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
      static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* SaveResetException */
      #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
      #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* RaiseException */
        #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(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;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* SliceObject */
          static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* PyObjectCallMethod0 */
          static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* UnpackUnboundCMethod */
          static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod0 */
          static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* pop */
          static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (Py_TYPE(L) == &PySet_Type) {
        return PySet_Pop(L);
    }
#endif
    return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop);
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
    if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
        Py_SIZE(L) -= 1;
        return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
    }
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* FetchCommonType */
          static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
          static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_COMPILING_IN_CPYTHON
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    PyObject *self = f->m_self;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* decode_c_string */
              static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* dict_getitem_default */
              static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    } else {
        if (default_value == Py_None)
            default_value = NULL;
        value = PyObject_CallMethodObjArgs(
            d, __pyx_n_s_get_2, key, default_value, NULL);
    }
#endif
    return value;
}

/* RaiseTooManyValuesToUnpack */
              static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
              static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
              static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
              static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* GetItemInt */
              static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* StringJoin */
              #if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* PyIntBinop */
              #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* SetItemInt */
              static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* SwapException */
                #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* ExtTypeTest */
                static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* None */
                static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyObjectCallMethod1 */
                static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

/* append */
                static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyIntBinop */
                #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyErrExceptionMatches */
                #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* SetVTable */
                static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* Import */
                static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
                static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CalculateMetaclass */
                static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
                static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CodeObjectCache */
                static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
                #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
                #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_u_short(u_short value) {
    const u_short neg_one = (u_short) -1, const_zero = (u_short) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(u_short) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(u_short) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(u_short) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(u_short) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(u_short) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(u_short),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(unsigned char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_sa_family_t(sa_family_t value) {
    const sa_family_t neg_one = (sa_family_t) -1, const_zero = (sa_family_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(sa_family_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(sa_family_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(sa_family_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(sa_family_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(sa_family_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(sa_family_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_u_char(u_char value) {
    const u_char neg_one = (u_char) -1, const_zero = (u_char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(u_char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(u_char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(u_char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(u_char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(u_char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(u_char),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
                static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
            } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint32_t) -1;
        }
    } else {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) {
    const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT) {
                            return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT) {
                            return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT) {
                            return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x))
            } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned long) -1;
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned long) -1;
        val = __Pyx_PyInt_As_unsigned_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned long");
    return (unsigned long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned long");
    return (unsigned long) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE u_short __Pyx_PyInt_As_u_short(PyObject *x) {
    const u_short neg_one = (u_short) -1, const_zero = (u_short) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(u_short) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(u_short, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (u_short) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (u_short) 0;
                case  1: __PYX_VERIFY_RETURN_INT(u_short, digit, digits[0])
                case 2:
                    if (8 * sizeof(u_short) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) >= 2 * PyLong_SHIFT) {
                            return (u_short) (((((u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(u_short) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) >= 3 * PyLong_SHIFT) {
                            return (u_short) (((((((u_short)digits[2]) << PyLong_SHIFT) | (u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(u_short) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) >= 4 * PyLong_SHIFT) {
                            return (u_short) (((((((((u_short)digits[3]) << PyLong_SHIFT) | (u_short)digits[2]) << PyLong_SHIFT) | (u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (u_short) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(u_short) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_short, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(u_short) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (u_short) 0;
                case -1: __PYX_VERIFY_RETURN_INT(u_short, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(u_short,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(u_short) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) - 1 > 2 * PyLong_SHIFT) {
                            return (u_short) (((u_short)-1)*(((((u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(u_short) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) - 1 > 2 * PyLong_SHIFT) {
                            return (u_short) ((((((u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(u_short) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) - 1 > 3 * PyLong_SHIFT) {
                            return (u_short) (((u_short)-1)*(((((((u_short)digits[2]) << PyLong_SHIFT) | (u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(u_short) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) - 1 > 3 * PyLong_SHIFT) {
                            return (u_short) ((((((((u_short)digits[2]) << PyLong_SHIFT) | (u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(u_short) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) - 1 > 4 * PyLong_SHIFT) {
                            return (u_short) (((u_short)-1)*(((((((((u_short)digits[3]) << PyLong_SHIFT) | (u_short)digits[2]) << PyLong_SHIFT) | (u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(u_short) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_short) - 1 > 4 * PyLong_SHIFT) {
                            return (u_short) ((((((((((u_short)digits[3]) << PyLong_SHIFT) | (u_short)digits[2]) << PyLong_SHIFT) | (u_short)digits[1]) << PyLong_SHIFT) | (u_short)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(u_short) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_short, long, PyLong_AsLong(x))
            } else if (sizeof(u_short) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_short, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            u_short val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (u_short) -1;
        }
    } else {
        u_short val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (u_short) -1;
        val = __Pyx_PyInt_As_u_short(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to u_short");
    return (u_short) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to u_short");
    return (u_short) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) {
                            return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) {
                            return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) {
                            return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
            } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned char) -1;
        }
    } else {
        unsigned char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned char) -1;
        val = __Pyx_PyInt_As_unsigned_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned char");
    return (unsigned char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned char");
    return (unsigned char) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE u_char __Pyx_PyInt_As_u_char(PyObject *x) {
    const u_char neg_one = (u_char) -1, const_zero = (u_char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(u_char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(u_char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (u_char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (u_char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(u_char, digit, digits[0])
                case 2:
                    if (8 * sizeof(u_char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) >= 2 * PyLong_SHIFT) {
                            return (u_char) (((((u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(u_char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) >= 3 * PyLong_SHIFT) {
                            return (u_char) (((((((u_char)digits[2]) << PyLong_SHIFT) | (u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(u_char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) >= 4 * PyLong_SHIFT) {
                            return (u_char) (((((((((u_char)digits[3]) << PyLong_SHIFT) | (u_char)digits[2]) << PyLong_SHIFT) | (u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (u_char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(u_char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_char, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(u_char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (u_char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(u_char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(u_char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(u_char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) - 1 > 2 * PyLong_SHIFT) {
                            return (u_char) (((u_char)-1)*(((((u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(u_char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) - 1 > 2 * PyLong_SHIFT) {
                            return (u_char) ((((((u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(u_char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) - 1 > 3 * PyLong_SHIFT) {
                            return (u_char) (((u_char)-1)*(((((((u_char)digits[2]) << PyLong_SHIFT) | (u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(u_char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) - 1 > 3 * PyLong_SHIFT) {
                            return (u_char) ((((((((u_char)digits[2]) << PyLong_SHIFT) | (u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(u_char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) - 1 > 4 * PyLong_SHIFT) {
                            return (u_char) (((u_char)-1)*(((((((((u_char)digits[3]) << PyLong_SHIFT) | (u_char)digits[2]) << PyLong_SHIFT) | (u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(u_char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(u_char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(u_char) - 1 > 4 * PyLong_SHIFT) {
                            return (u_char) ((((((((((u_char)digits[3]) << PyLong_SHIFT) | (u_char)digits[2]) << PyLong_SHIFT) | (u_char)digits[1]) << PyLong_SHIFT) | (u_char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(u_char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_char, long, PyLong_AsLong(x))
            } else if (sizeof(u_char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(u_char, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            u_char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (u_char) -1;
        }
    } else {
        u_char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (u_char) -1;
        val = __Pyx_PyInt_As_u_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to u_char");
    return (u_char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to u_char");
    return (u_char) -1;
}

/* CoroutineBase */
                #include <structmember.h>
#include <frameobject.h>
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
#if PY_VERSION_HEX >= 0x030300A0
        if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
#endif
        if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            } else if (PyTuple_Check(ev)) {
                if (PyTuple_GET_SIZE(ev) >= 1) {
                    PyObject *value;
#if CYTHON_COMPILING_IN_CPYTHON
                    value = PySequence_ITEM(ev, 0);
#else
                    value = PyTuple_GET_ITEM(ev, 0);
                    Py_INCREF(value);
#endif
                    Py_DECREF(ev);
                    ev = value;
                } else {
                    Py_INCREF(Py_None);
                    Py_DECREF(ev);
                    ev = Py_None;
                }
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
    PyObject *retval;
    __Pyx_PyThreadState_declare
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    __Pyx_PyThreadState_assign
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(__pyx_tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = __pyx_tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
    if (unlikely(!retval && !PyErr_Occurred())) {
        PyErr_SetNone(PyExc_StopIteration);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Coroutine_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value);
    }
    return __Pyx_Coroutine_MethodReturn(retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
            goto throw_here;
        }
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label > 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Coroutine_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
    Py_INCREF(self->gi_name);
    return self->gi_name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject* type, __pyx_coroutine_body_t body,
                                                   PyObject *closure, PyObject *name, PyObject *qualname) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
                    static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
                    #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (!abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_VERSION_HEX >= 0x03030000) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if (0) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
                    static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
                    static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
                    static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
