# Path: sdn/models/switch.py
# class Switch(BaseModel):
#     # Buffers
#     buffers = models.IntegerField()
# 
#     # Description
#     software = models.CharField(max_length=100)
#     hardware = models.CharField(max_length=100)
#     manufacturer = models.CharField(max_length=100)
#     serial_num = models.CharField(max_length=100)
#     datapath = models.CharField(max_length=100)
# 
#     # Capabilities
#     capabilities = models.IntegerField()
# 
#     # Inet Address
#     inet_address = models.CharField(max_length=100)
# 
#     # Connected Since
#     connected_since = models.BigIntegerField()
# 
#     # DPID
#     dpid = models.CharField(max_length=100, db_index=True)
# 
#     # Foreign key to controller
#     controller = models.ForeignKey(Controller)
# 
# Path: sdn/models/base_model.py
# class BaseModel(models.Model):
#     class Meta:
#         # Makes django recognize model in split modules
#         app_label = 'sdn'
#         # Turns this into an abstract model (does not create table for it)
#         abstract = True
# 
#     # Default exception for models in manager
#     class ModelException(Exception):
#         # Get an instance of a logger
#         logger = logging.getLogger(__name__)
# 
#         def __init__(self, msg):
#             self.msg = msg
#             self.logger.warning(msg)
# 
#         def __str__(self):
#             return repr(self.msg)


from django.db import models
from sdn.models.switch import Switch
from sdn.models.base_model import BaseModel
                        message_subsubtype = None
                    elif 'PacketOut' in msg_subtype:
                        message_subtype = 'PACKET_OUT'
                        message_subsubtype = None
                    else:
                        message_subtype = msg_subtype
                    if 'PacketIn' in msg_subtype and len(row) > 3:
                        msg_subsubtype = row[4]
                        if 'unicast' in msg_subsubtype:
                            message_subsubtype = 'unicast'
                        elif 'broadcast' in msg_subsubtype:
                            message_subsubtype = 'broadcast'
                        elif 'L3' in msg_subsubtype:
                            msg_subsubtype = row[5]
                            if 'ARP' in msg_subsubtype:
                                message_subsubtype = 'L3_ARP'
                            elif '8942' in msg_subsubtype:
                                message_subsubtype = 'L3_8942'
                            elif 'IPv4' in msg_subsubtype:
                                message_subsubtype = 'L3_IPv4'
                            elif 'LLDP' in msg_subsubtype:
                                message_subsubtype = 'L3_LLDP'
                        elif 'L4' in msg_subsubtype:
                            msg_subsubtype = row[5]
                            if 'ICMP' in msg_subsubtype:
                                message_subsubtype = 'L4_ICMP'
                            elif 'UDP' in msg_subsubtype:
                                message_subsubtype = 'L4_UDP'
                    list_counters.append({'dpid':switch_dpid,'msg_subtype':message_subtype,'msg_subsubtype':message_subsubtype,'counter_packets':value})


# Path: sdn/models/switch.py
# class Switch(BaseModel):
#     # Buffers
#     buffers = models.IntegerField()
# 
#     # Description
#     software = models.CharField(max_length=100)
#     hardware = models.CharField(max_length=100)
#     manufacturer = models.CharField(max_length=100)
#     serial_num = models.CharField(max_length=100)
#     datapath = models.CharField(max_length=100)
# 
#     # Capabilities
#     capabilities = models.IntegerField()
# 
#     # Inet Address
#     inet_address = models.CharField(max_length=100)
# 
#     # Connected Since
#     connected_since = models.BigIntegerField()
# 
#     # DPID
#     dpid = models.CharField(max_length=100, db_index=True)
# 
#     # Foreign key to controller
#     controller = models.ForeignKey(Controller)
# 
# Path: sdn/models/base_model.py
# class BaseModel(models.Model):
#     class Meta:
#         # Makes django recognize model in split modules
#         app_label = 'sdn'
#         # Turns this into an abstract model (does not create table for it)
#         abstract = True
# 
#     # Default exception for models in manager
#     class ModelException(Exception):
#         # Get an instance of a logger
#         logger = logging.getLogger(__name__)
# 
#         def __init__(self, msg):
#             self.msg = msg
#             self.logger.warning(msg)
# 
#         def __str__(self):
#             return repr(self.msg)


# Path: sdn/models/openflow_message_counter1_0.py
from django.db import models
from sdn.models.switch import Switch
from sdn.models.base_model import BaseModel

                        message_subsubtype = None
                    elif 'PacketOut' in msg_subtype:
                        message_subtype = 'PACKET_OUT'
                        message_subsubtype = None
                    else:
                        message_subtype = msg_subtype
                    if 'PacketIn' in msg_subtype and len(row) > 3:
                        msg_subsubtype = row[4]
                        if 'unicast' in msg_subsubtype:
                            message_subsubtype = 'unicast'
                        elif 'broadcast' in msg_subsubtype:
                            message_subsubtype = 'broadcast'
                        elif 'L3' in msg_subsubtype:
                            msg_subsubtype = row[5]
                            if 'ARP' in msg_subsubtype:
                                message_subsubtype = 'L3_ARP'
                            elif '8942' in msg_subsubtype:
                                message_subsubtype = 'L3_8942'
                            elif 'IPv4' in msg_subsubtype:
                                message_subsubtype = 'L3_IPv4'
                            elif 'LLDP' in msg_subsubtype:
                                message_subsubtype = 'L3_LLDP'
                        elif 'L4' in msg_subsubtype:
                            msg_subsubtype = row[5]
                            if 'ICMP' in msg_subsubtype:
                                message_subsubtype = 'L4_ICMP'
                            elif 'UDP' in msg_subsubtype:
                                message_subsubtype = 'L4_UDP'
                    list_counters.append({'dpid':switch_dpid,'msg_subtype':message_subtype,'msg_subsubtype':message_subsubtype,'counter_packets':value})


        new_list_counters = {}