diff --git a/back/src/test_json/arp_proxy_answer.json b/back/src/test_json/arp_proxy_answer.json new file mode 100644 index 00000000..1dfcce37 --- /dev/null +++ b/back/src/test_json/arp_proxy_answer.json @@ -0,0 +1,162 @@ +[ + [ + { + "data": { + "id": "", + "label": "ARP-request\nWho has 10.0.1.2? Tell 10.0.0.1", + "type": "packet" + }, + "config": { + "type": "ARP-request\nWho has 10.0.1.2? Tell 10.0.0.1", + "path": "edge_m8u7gssjgno35ir8b3", + "source": "host_1", + "target": "router_1" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ARP-response", + "type": "packet" + }, + "config": { + "type": "ARP-response", + "path": "edge_m8u7gssjgno35ir8b3", + "source": "router_1", + "target": "host_1" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ICMP echo-request\n10.0.0.1 > 10.0.1.2", + "type": "packet" + }, + "config": { + "type": "ICMP echo-request\n10.0.0.1 > 10.0.1.2", + "path": "edge_m8u7gssjgno35ir8b3", + "source": "host_1", + "target": "router_1" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ARP-request\nWho has 10.0.1.2? Tell 10.0.1.1", + "type": "packet" + }, + "config": { + "type": "ARP-request\nWho has 10.0.1.2? Tell 10.0.1.1", + "path": "edge_m8u7gui9n4nyg3jko6", + "source": "router_1", + "target": "host_2" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ARP-response", + "type": "packet" + }, + "config": { + "type": "ARP-response", + "path": "edge_m8u7gui9n4nyg3jko6", + "source": "host_2", + "target": "router_1" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ICMP echo-request\n10.0.0.1 > 10.0.1.2", + "type": "packet" + }, + "config": { + "type": "ICMP echo-request\n10.0.0.1 > 10.0.1.2", + "path": "edge_m8u7gui9n4nyg3jko6", + "source": "router_1", + "target": "host_2" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ARP-request\nWho has 10.0.0.1? Tell 10.0.1.2", + "type": "packet" + }, + "config": { + "type": "ARP-request\nWho has 10.0.0.1? Tell 10.0.1.2", + "path": "edge_m8u7gui9n4nyg3jko6", + "source": "host_2", + "target": "router_1" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ARP-response", + "type": "packet" + }, + "config": { + "type": "ARP-response", + "path": "edge_m8u7gui9n4nyg3jko6", + "source": "router_1", + "target": "host_2" + }, + "timestamp": "" + } + ], + [ + { + "data": { + "id": "", + "label": "ICMP echo-reply\n10.0.1.2 > 10.0.0.1", + "type": "packet" + }, + "config": { + "type": "ICMP echo-reply\n10.0.1.2 > 10.0.0.1", + "path": "edge_m8u7gui9n4nyg3jko6", + "source": "host_2", + "target": "router_1" + }, + "timestamp": "" + } + ], + [ + { + "config": { + "type": "ICMP echo-reply\n10.0.1.2 > 10.0.0.1", + "path": "edge_m8u7gssjgno35ir8b3", + "source": "router_1", + "target": "host_1" + }, + "data": { + "id": "", + "label": "ICMP echo-reply\n10.0.1.2 > 10.0.0.1", + "type": "packet" + }, + "timestamp": "" + } + ] +] \ No newline at end of file diff --git a/back/src/test_json/arp_proxy_network.json b/back/src/test_json/arp_proxy_network.json new file mode 100644 index 00000000..8af14b19 --- /dev/null +++ b/back/src/test_json/arp_proxy_network.json @@ -0,0 +1,136 @@ +{ + "jobs": [ + { + "arg_1": "10.0.1.2", + "host_id": "host_1", + "id": "866e0a6e9de9450dba6e9a12c55f762e", + "job_id": 1, + "level": 0, + "print_cmd": "ping -c 1 10.0.1.2" + }, + { + "arg_1": "iface_74627000", + "arg_2": "host_1", + "host_id": "router_1", + "id": "9eb7c8b8a5d44a7bbf8d9dd40a7c568b", + "job_id": 107, + "level": 1, + "print_cmd": "arp proxy: host_1" + }, + { + "arg_1": "iface_36584304", + "arg_2": "host_2", + "host_id": "router_1", + "id": "8a8ac1210bd54902a7b81b555b5e9d0a", + "job_id": 107, + "level": 2, + "print_cmd": "arp proxy: host_2" + } + ], + "nodes": [ + { + "classes": [ "host" ], + "config": { + "default_gw": "", + "label": "host_1", + "type": "host" + }, + "data": { + "id": "host_1", + "label": "host_1" + }, + "interface": [ + { + "connect": "edge_m8u7gssjgno35ir8b3", + "id": "iface_37257110", + "ip": "10.0.0.1", + "name": "iface_37257110", + "netmask": 12 + } + ], + "position": { + "x": 126.25, + "y": 193 + } + }, + { + "classes": [ "l3_router" ], + "config": { + "default_gw": "", + "label": "router_1", + "type": "router" + }, + "data": { + "id": "router_1", + "label": "router_1" + }, + "interface": [ + { + "connect": "edge_m8u7gssjgno35ir8b3", + "id": "iface_74627000", + "ip": "10.0.0.2", + "name": "iface_74627000", + "netmask": 24 + }, + { + "connect": "edge_m8u7gui9n4nyg3jko6", + "id": "iface_36584304", + "ip": "10.0.1.1", + "name": "iface_36584304", + "netmask": 24 + } + ], + "position": { + "x": 210.25, + "y": 119.796875 + } + }, + { + "classes": [ "host" ], + "config": { + "default_gw": "", + "label": "host_2", + "type": "host" + }, + "data": { + "id": "host_2", + "label": "host_2" + }, + "interface": [ + { + "connect": "edge_m8u7gui9n4nyg3jko6", + "id": "iface_16763880", + "ip": "10.0.1.2", + "name": "iface_16763880", + "netmask": 12 + } + ], + "position": { + "x": 291.25, + "y": 188.5 + } + } + ], + "edges": [ + { + "data": { + "id": "edge_m8u7gssjgno35ir8b3", + "source": "host_1", + "target": "router_1" + } + }, + { + "data": { + "id": "edge_m8u7gui9n4nyg3jko6", + "source": "router_1", + "target": "host_2" + } + } + ], + "config": { + "zoom": 2, + "pan_x": 0, + "pan_y": 0 + }, + "pcap": [] +} \ No newline at end of file diff --git a/back/src/test_miminet_example_works.py b/back/src/test_miminet_example_works.py index b0bfe999..1e5830ea 100644 --- a/back/src/test_miminet_example_works.py +++ b/back/src/test_miminet_example_works.py @@ -55,6 +55,13 @@ def read_files(network_filename: str, answer_filename: str): len("ARP-response\\n10.0.0.1 at "), r"mac", ), + ( + "arp_proxy_network.json", + "arp_proxy_answer.json", + r"ARP-response\\n.+ at ([0-9a-fA-F]{2}[:]){6}", + len("ARP-response\\n10.0.0.1 at "), + r"mac", + ), ]