Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixed ordering of decode func
  • Loading branch information
Abhinavcode13 authored Apr 14, 2024
commit 55ef8243c3550aa73cf22f6952e6c2962d36f53e
3 changes: 1 addition & 2 deletions utils/p4runtime_lib/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ def encode(x, bitwidth):
return encoded_bytes

def decode(enc_val):
decode_functions = [decodeIPv4, decodeMac, decodeNum, decodeIPv6]
decode_functions = [decodeIPv6, decodeIPv4, decodeMac, decodeNum]
for func in decode_functions:
try:
return func(enc_val)
except:
pass
raise Exception("Not compatible with the encoded value format")


if __name__ == '__main__':
# TODO These tests should be moved out of main eventually
mac = "aa:bb:cc:dd:ee:ff"
Expand Down