Project

General

Profile

DesignHistory » packet.py

Module with the object definition for the data - Adrian Georgescu, 08/29/2010 01:34 PM

 
from itertools import count


class Packet(object):
id_generator = count().next

def __init__(self, timestamp, direction, source_address, source_port, destination_address, destination_port, protocol, packet):
self.id = self.id_generator()
self.timestamp = timestamp
self.direction = direction
self.source_address = source_address
self.source_port = source_port
self.destination_adddress = destination_address
self.destination_port = destination_port
self.protocol = protocol
self.packet = packet

(4-4/4)