- _set_xdp_map("map_xdp_setup",
+ bpf_map_set("map_xdp_setup",
TestConfig.ADJST_OFFSET.value,
offset)
- _set_xdp_map("map_xdp_setup", TestConfig.ADJST_TAG.value, int(tag,
16))
- _set_xdp_map("map_xdp_setup", TestConfig.ADJST_OFFSET.value,
offset)
+ bpf_map_set("map_xdp_setup", TestConfig.ADJST_TAG.value, int(tag,
16))
+ bpf_map_set("map_xdp_setup", TestConfig.ADJST_OFFSET.value, offset)
Looks like a duplicate call to adjust the offset?
+def format_hex_bytes(value):
+ """
+ Helper function that converts an integer into a formatted hexadecimal byte
string.
+
+ Args:
+ value: An integer representing the number to be converted.
+
+ Returns:
+ A string representing hexadecimal equivalent of value, with bytes
separated by spaces.
+ """
+ hex_str = value.to_bytes(4, byteorder='little', signed=True)
+ return ' '.join(f'{byte:02x}' for byte in hex_str)
+
+
Since format_hex_bytes is not exported in __init__.py, Should it be
prefixed with _ to indicate it is private?