master-thesis/bin/gen_v4_table_test_entries.py
Nico Schottelius 9c205bc39e chmod u+x
2019-08-15 14:59:13 +02:00

11 lines
507 B
Python
Executable file

#!/usr/bin/env python3
import ipaddress
for i in range(1,65):
addr = ipaddress.IPv4Address("10.0.0.{}".format(i))
ip_int = int(addr)
print("table_cam_add_entry realmain_v4_networks_0 realmain.set_egress_port {} => 1 {} {} 0 0".format(ip_int, i, i))
# print("table_cam_add_entry realmain_v4_networks_0 realmain.set_egress_port {} => {} {} 0 0 0".format(ip_int, i, i))
# print("table_cam_add_entry realmain_v4_networks_0 realmain.set_egress_port {} => {} {} {} 0 0".format(ip_int, i, i))