mirror of
https://github.com/alexforencich/verilog-ethernet.git
synced 2025-01-14 06:43:18 +08:00
Rename checksum to calc_checksum in ip_ep
This commit is contained in:
parent
8191b38e7a
commit
ebc1c7ccc6
@ -117,7 +117,7 @@ class IPFrame(object):
|
||||
def update_length(self):
|
||||
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_length
|
||||
cksum += self.ip_identification
|
||||
@ -132,7 +132,7 @@ class IPFrame(object):
|
||||
return ~cksum & 0xffff
|
||||
|
||||
def update_checksum(self):
|
||||
self.ip_header_checksum = self.checksum()
|
||||
self.ip_header_checksum = self.calc_checksum()
|
||||
|
||||
def build(self):
|
||||
if self.ip_length is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user