# Path: duct/protocol/sflow/protocol/utils.py
# def unpack_address(u):
#     def __init__(self, addr_int):
#     def __str__(self):
#     def asString(self):
#     def __repr__(self):
# class IPv4Address(object):


from construct import (BitStruct,
                       Bits,
                       Bytes,
                       Const,
                       EmbeddedBitStruct,
                       Enum,
                       Flag,
                       Nibble,
                       Padding,
                       Struct,
                       UBInt8,
                       UBInt16,
                       UBInt32)
from construct.adapters import MappingError
from duct.protocol.sflow.protocol import utils
from twisted.python import log
        self.src_as = u.unpack_uint()
        self.src_peer_as = u.unpack_uint()

        self.as_path_type = u.unpack_uint()
        self.as_path = u.unpack_array(u.unpack_uint)

        self.communities = u.unpack_array(u.unpack_uint)
        self.localpref = u.unpack_uint()

class UserSample(object):
    """User sample
    """
    def __init__(self, u):
        self.src_charset = u.unpack_uint()
        self.src_user = u.unpack_string()
        self.dst_charset = u.unpack_uint()
        self.dst_user = u.unpack_string()

class URLSample(object):
    """URL sample
    """
    def __init__(self, u):
        self.url_direction = u.unpack_uint()
        self.url = u.unpack_string()
        self.host = u.unpack_string()

class MPLSSample(object):
    """MPLS sample
    """
    def __init__(self, u):

# Path: duct/protocol/sflow/protocol/utils.py
# def unpack_address(u):
#     def __init__(self, addr_int):
#     def __str__(self):
#     def asString(self):
#     def __repr__(self):
# class IPv4Address(object):


# Path: duct/protocol/sflow/protocol/flows.py
from construct import (BitStruct,
                       Bits,
                       Bytes,
                       Const,
                       EmbeddedBitStruct,
                       Enum,
                       Flag,
                       Nibble,
                       Padding,
                       Struct,
                       UBInt8,
                       UBInt16,
                       UBInt32)
from construct.adapters import MappingError
from duct.protocol.sflow.protocol import utils
from twisted.python import log

        self.src_as = u.unpack_uint()
        self.src_peer_as = u.unpack_uint()

        self.as_path_type = u.unpack_uint()
        self.as_path = u.unpack_array(u.unpack_uint)

        self.communities = u.unpack_array(u.unpack_uint)
        self.localpref = u.unpack_uint()

class UserSample(object):
    """User sample
    """
    def __init__(self, u):
        self.src_charset = u.unpack_uint()
        self.src_user = u.unpack_string()
        self.dst_charset = u.unpack_uint()
        self.dst_user = u.unpack_string()

class URLSample(object):
    """URL sample
    """
    def __init__(self, u):
        self.url_direction = u.unpack_uint()
        self.url = u.unpack_string()
        self.host = u.unpack_string()

class MPLSSample(object):
    """MPLS sample
    """
    def __init__(self, u):

        self.next_hop = utils.unpack_address(u)