packet.py

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

Download (577 Bytes)

 
1
from itertools import count
2

    
3

    
4
class Packet(object):
5
    id_generator = count().next
6

    
7
    def __init__(self, timestamp, direction, source_address, source_port, destination_address, destination_port, protocol, packet):
8
        self.id = self.id_generator()
9
        self.timestamp = timestamp
10
        self.direction = direction
11
        self.source_address = source_address
12
        self.source_port = source_port
13
        self.destination_adddress = destination_address
14
        self.destination_port = destination_port
15
        self.protocol = protocol
16
        self.packet = packet
17