# 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
#
# Copyright (c) 2014 by Christian E. Hopps.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import absolute_import, division, nested_scopes, print_function, unicode_literals

# from ctypes import Structure, c_uint8


logger = logbook.Logger(__name__)


#=====================
# TLV Parsing Objects
#=====================


def area_addr_factory (value):

# 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

#
# Copyright (c) 2014 by Christian E. Hopps.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import absolute_import, division, nested_scopes, print_function, unicode_literals

# from ctypes import Structure, c_uint8


logger = logbook.Logger(__name__)


#=====================
# TLV Parsing Objects
#=====================


def area_addr_factory (value):

    alen = ord(value[0])