# Path: pyisis/lib/util.py
# def as_string (cobj):
# def cast_as (bufptr, ctype):
# def copy_as (s, ctype):
# def copy_cobj (s, ctype):
# def memcpy (dst, src):
#     def _chr3 (val):
#     def buffer3 (val, off=None, sz=None):
#     def tlvrdb (val):
#     def buffer3 (val, off=None, l=None):
#     def stringify3 (b):
# def debug_exception ():
#     def __init__ (self):
#     def elapsed (self):
#     def __str__ (self):
#     def __init__ (self, lifetime):
#     def reset (self, lifetime):
#     def expire_at (self):
#     def timeleft (self):
#     def __init__ (self):
#     def __enter__ (self):
#     def __exit__ (self, *args):
#     def held (self):
#     def acquire (self, blocking=True):
#     def release (self):
# def debug_after (count=1):
#     def __enter__ (self):
#     def __exit__ (self, *args):
# class CPUTimer (object):
# class Lifetime (object):
# class QueryLock (object):
# class NoLock (object):


from collections import defaultdict
from ctypes import BigEndianStructure
from ctypes import c_uint8, c_uint16, c_uint32, memmove, sizeof
from pyisis.bstr import memspan                             # pylint: disable=E0611
from pyisis.lib.util import buffer3, tlvrdb, tlvwrb, xrange3
import pyisis.lib.util as util
import ipaddress
import logbook
import pdb
import struct
import sys
import pyisis.clns as clns
                vlen, addrlen))

        for i in xrange3(0, vlen, addrlen):
            self.addrs.append(self._coerce_value(value[i: i + addrlen]))


class _FixedValuesTLV (TLV):
    @classmethod
    def _coerce_value (cls, value):
        return value

    def __init__ (self, bufptr, valuelen, hasvflag=False):
        super(_FixedValuesTLV, self).__init__(bufptr)

        self.values = []
        """List of values"""

        value = self.value
        vlen = len(self.value)

        if not hasvflag:
            start = 0
        else:
            start = 1
            self.virtual = True if value[0] else False

        if (vlen - start) % valuelen:
            raise ValueError("Length of addr data {} not divisible by {}".format(
                vlen, valuelen))


# Path: pyisis/lib/util.py
# def as_string (cobj):
# def cast_as (bufptr, ctype):
# def copy_as (s, ctype):
# def copy_cobj (s, ctype):
# def memcpy (dst, src):
#     def _chr3 (val):
#     def buffer3 (val, off=None, sz=None):
#     def tlvrdb (val):
#     def buffer3 (val, off=None, l=None):
#     def stringify3 (b):
# def debug_exception ():
#     def __init__ (self):
#     def elapsed (self):
#     def __str__ (self):
#     def __init__ (self, lifetime):
#     def reset (self, lifetime):
#     def expire_at (self):
#     def timeleft (self):
#     def __init__ (self):
#     def __enter__ (self):
#     def __exit__ (self, *args):
#     def held (self):
#     def acquire (self, blocking=True):
#     def release (self):
# def debug_after (count=1):
#     def __enter__ (self):
#     def __exit__ (self, *args):
# class CPUTimer (object):
# class Lifetime (object):
# class QueryLock (object):
# class NoLock (object):


# Path: pyisis/tlv.py
from collections import defaultdict
from ctypes import BigEndianStructure
from ctypes import c_uint8, c_uint16, c_uint32, memmove, sizeof
from pyisis.bstr import memspan                             # pylint: disable=E0611
from pyisis.lib.util import buffer3, tlvrdb, tlvwrb, xrange3
import pyisis.lib.util as util
import ipaddress
import logbook
import pdb
import struct
import sys
import pyisis.clns as clns

                vlen, addrlen))

        for i in xrange3(0, vlen, addrlen):
            self.addrs.append(self._coerce_value(value[i: i + addrlen]))


class _FixedValuesTLV (TLV):
    @classmethod
    def _coerce_value (cls, value):
        return value

    def __init__ (self, bufptr, valuelen, hasvflag=False):
        super(_FixedValuesTLV, self).__init__(bufptr)

        self.values = []
        """List of values"""

        value = self.value
        vlen = len(self.value)

        if not hasvflag:
            start = 0
        else:
            start = 1
            self.virtual = True if value[0] else False

        if (vlen - start) % valuelen:
            raise ValueError("Length of addr data {} not divisible by {}".format(
                vlen, valuelen))


        for i in xrange3(start, vlen, valuelen):