Skip to content

Commit

Permalink
Fix link variable call
Browse files Browse the repository at this point in the history
  • Loading branch information
agustiner committed Jan 25, 2024
1 parent 9aaa8cb commit 35e59ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/surf/ethernet/udp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def getPortValue(var):

def setPortValue(var, value, write):
newValue = int.from_bytes(value.to_bytes(2, byteorder='little'), byteorder='big', signed=False)
var.dependencies[0].set(newValue,write)
var.dependencies[0].set(newValue,write=write)

def getIpValue(var):
x = var.dependencies[0].value()
Expand All @@ -30,7 +30,7 @@ def getIpValue(var):
def setIpValue(var, value, write):
x = int(ipaddress.IPv4Address(value))
newValue = int.from_bytes(x.to_bytes(4, byteorder='little'), byteorder='big', signed=False)
var.dependencies[0].set(newValue,write)
var.dependencies[0].set(newValue,write=write)

def getMacValue(var):
x = var.dependencies[0].value()
Expand All @@ -41,4 +41,5 @@ def setMacValue(var, value, write):
if( len(x) == 6):
x = [int(i,16) for i in x]
newValue = ( '0x%02x%02x%02x%02x%02x%02x' % (x[5],x[4],x[3],x[2],x[1],x[0]) )
var.dependencies[0].set(int(newValue,16),write)
var.dependencies[0].set(int(newValue,16),write=write)

0 comments on commit 35e59ed

Please sign in to comment.