Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
162 changes: 162 additions & 0 deletions back/src/test_json/arp_proxy_answer.json
Original file line number Diff line number Diff line change
@@ -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": ""
}
]
]
136 changes: 136 additions & 0 deletions back/src/test_json/arp_proxy_network.json
Original file line number Diff line number Diff line change
@@ -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": []
}
7 changes: 7 additions & 0 deletions back/src/test_miminet_example_works.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
]


Expand Down
Loading