# Path: duct/protocol/sflow/protocol/protocol.py
# class Sflow(object):
# class FlowSample(object):
# class CounterSample(object):
#     def __init__(self, payload, host):
#     def sflow_v5(self, u):
#     def decode_samples(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
# 
# Path: duct/protocol/sflow/protocol/flows.py
# class IPv4Header(object):
# class ISO8023Header(object):
# class IPv6Header(object):
# class IEEE80211MACHeader(object):
# class PPPHeader(object):
# class HeaderSample(object):
# class EthernetSample(object):
# class IPV4Sample(object):
# class IPV6Sample(object):
# class SwitchSample(object):
# class RouterSample(object):
# class GatewaySample(object):
# class UserSample(object):
# class URLSample(object):
# class MPLSSample(object):
# class NATSample(object):
# class MPLSTunnelSample(object):
# class MPLSVCSample(object):
# class MPLSFTNSample(object):
# class MPLSLDPFECSample(object):
# class VLANTunnelSample(object):
#     def __init__(self, data):
#     def __init__(self, data):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
# def getDecoder(fmt):
# 
# Path: duct/protocol/sflow/protocol/counters.py
# class InterfaceCounters(object):
# class EthernetCounters(object):
# class VLANCounters(object):
# class TokenringCounters(object):
# class VGCounters(object):
# class HostCounters(object):
# class HostAdapters(object):
# class HostParent(object):
# class HostCPUCounters(object):
# class HostMemoryCounters(object):
# class DiskIOCounters(object):
# class NetIOCounters(object):
# class SocketIPv4Counters(object):
# class SocketIPv6Counters(object):
# class VirtMemoryCounters(object):
# class VirtDiskIOCounters(object):
# class VirtNetIOCounters(object):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
# def getDecoder(fmt):


from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from duct.protocol.sflow import protocol
from duct.protocol.sflow.protocol import flows, counters
"""
.. module:: server
   :synopsis: SFlow UDP server

.. moduleauthor:: Colin Alston <colin@imcol.in>
"""



class DatagramReceiver(DatagramProtocol):
    """DatagramReceiver for sFlow packets
    """
    def datagramReceived(self, data, address):
        host, _port = address
        sflow = protocol.Sflow(data, host)

        for sample in sflow.samples:
            if isinstance(sample, protocol.FlowSample):
                self.process_flow_sample(sflow, sample)


# Path: duct/protocol/sflow/protocol/protocol.py
# class Sflow(object):
# class FlowSample(object):
# class CounterSample(object):
#     def __init__(self, payload, host):
#     def sflow_v5(self, u):
#     def decode_samples(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
# 
# Path: duct/protocol/sflow/protocol/flows.py
# class IPv4Header(object):
# class ISO8023Header(object):
# class IPv6Header(object):
# class IEEE80211MACHeader(object):
# class PPPHeader(object):
# class HeaderSample(object):
# class EthernetSample(object):
# class IPV4Sample(object):
# class IPV6Sample(object):
# class SwitchSample(object):
# class RouterSample(object):
# class GatewaySample(object):
# class UserSample(object):
# class URLSample(object):
# class MPLSSample(object):
# class NATSample(object):
# class MPLSTunnelSample(object):
# class MPLSVCSample(object):
# class MPLSFTNSample(object):
# class MPLSLDPFECSample(object):
# class VLANTunnelSample(object):
#     def __init__(self, data):
#     def __init__(self, data):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
# def getDecoder(fmt):
# 
# Path: duct/protocol/sflow/protocol/counters.py
# class InterfaceCounters(object):
# class EthernetCounters(object):
# class VLANCounters(object):
# class TokenringCounters(object):
# class VGCounters(object):
# class HostCounters(object):
# class HostAdapters(object):
# class HostParent(object):
# class HostCPUCounters(object):
# class HostMemoryCounters(object):
# class DiskIOCounters(object):
# class NetIOCounters(object):
# class SocketIPv4Counters(object):
# class SocketIPv6Counters(object):
# class VirtMemoryCounters(object):
# class VirtDiskIOCounters(object):
# class VirtNetIOCounters(object):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
#     def __init__(self, u):
# def getDecoder(fmt):


# Path: duct/protocol/sflow/server.py
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from duct.protocol.sflow import protocol
from duct.protocol.sflow.protocol import flows, counters

"""
.. module:: server
   :synopsis: SFlow UDP server

.. moduleauthor:: Colin Alston <colin@imcol.in>
"""



class DatagramReceiver(DatagramProtocol):
    """DatagramReceiver for sFlow packets
    """
    def datagramReceived(self, data, address):
        host, _port = address
        sflow = protocol.Sflow(data, host)

        for sample in sflow.samples:
            if isinstance(sample, protocol.FlowSample):
                self.process_flow_sample(sflow, sample)


            if isinstance(sample, protocol.CounterSample):