def createPacketFromString(self, packet): packList = header.decodePacket(packet) self.sourceIP = packList[0] self.sourcePort = packList[1] self.destIP = packList[2] self.destPort = packList[3] self.seqNum = packList[4] self.ackNum = packList[5] self.payloadSize = packList[6] self.SYN = packList[7] self.ACK = packList[8] self.FIN = packList[9] self.LAST = packList[10] self.FIRST = packList[11] self.recvWindow = packList[12] self.timeStamp = packList[13] self.payload = packList[14] self.packlist = packList self.checksum = packet[28:32]
def getPacket(packet): return header.decodePacket(packet)