Skip to content
Snippets Groups Projects
Commit 69559e3a authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

fix bug wrong function name

parent 70ade8a3
No related branches found
No related tags found
No related merge requests found
......@@ -59,14 +59,14 @@ def packet_handler(packet):
print(json_array)
file_path = DIR + '/ubuntu_intermediate/inter_op_ebpf.c'
update_ebpf_file(file_path, packet[IP].src, 75, json_array)
update_ebpf_file(file_path, packet[IP].dst, 75, json_array)
stop_sniffing = True
except (UnicodeDecodeError, json.JSONDecodeError):
print(f"Raw data: {udp_payload.hex()}")
def update_ebpf_file():
def update_ebpf_sniff():
sniff(iface="br0", filter="udp port 5000", prn=packet_handler, stop_filter=lambda _: stop_sniffing)
print("Sniffing complete")
......@@ -83,7 +83,7 @@ def main():
b.attach_xdp(inter_name, fn, 0)
print("Attach the ebpf program at", inter_name)
update_ebpf_file()
update_ebpf_sniff()
for inter_num in range(2, 13):
inter_name = f"ens{inter_num + 1}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment