1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

Rename checksum to calc_checksum in ip_ep

This commit is contained in:
Alex Forencich 2014-09-25 16:26:23 -07:00
parent 8191b38e7a
commit ebc1c7ccc6

View File

@ -117,7 +117,7 @@ class IPFrame(object):
def update_length(self): def update_length(self):
self.ip_length = len(self.payload.data) + 20 self.ip_length = len(self.payload.data) + 20
def checksum(self): def calc_checksum(self):
cksum = self.ip_version << 12 | self.ip_ihl << 8 | self.ip_dscp << 2 | self.ip_ecn cksum = self.ip_version << 12 | self.ip_ihl << 8 | self.ip_dscp << 2 | self.ip_ecn
cksum += self.ip_length cksum += self.ip_length
cksum += self.ip_identification cksum += self.ip_identification
@ -132,7 +132,7 @@ class IPFrame(object):
return ~cksum & 0xffff return ~cksum & 0xffff
def update_checksum(self): def update_checksum(self):
self.ip_header_checksum = self.checksum() self.ip_header_checksum = self.calc_checksum()
def build(self): def build(self):
if self.ip_length is None: if self.ip_length is None: