+def parse_args():
+ """Parse arguments from cmd line.
+
+ :return: Parsed arguments.
+ :rtype ArgumentParser
+ """
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-d", "--duration", required=True, type=int,
+ help="Duration of traffic run")
+ parser.add_argument("-s", "--frame_size", required=True,
+ help="Size of a Frame without padding and IPG")
+ parser.add_argument("-r", "--rate", required=True,
+ help="Traffic rate with included units (%, pps)")
+ parser.add_argument("-6", "--use_IPv6", action="store_true",
+ default=False,
+ help="Use IPv6 traffic profile instead of IPv4")
+ parser.add_argument("--async", action="store_true",
+ default=False,
+ help="Non-blocking call of the script")
+ parser.add_argument("--latency", action="store_true",
+ default=False,
+ help="Add latency stream")
+ parser.add_argument("-w", "--warmup_time", type=int,
+ default=5,
+ help="Traffic warmup time in seconds, 0 = disable")
+# parser.add_argument("--p1_src_mac",
+# help="Port 1 source MAC address")
+# parser.add_argument("--p1_dst_mac",
+# help="Port 1 destination MAC address")
+ parser.add_argument("--p1_src_start_ip", required=True,
+ help="Port 1 source start IP address")
+ parser.add_argument("--p1_src_end_ip",
+ default=False,
+ help="Port 1 source end IP address")
+ parser.add_argument("--p1_dst_start_ip", required=True,
+ help="Port 1 destination start IP address")
+ parser.add_argument("--p1_dst_end_ip",
+ default=False,
+ help="Port 1 destination end IP address")
+# parser.add_argument("--p2_src_mac",
+# help="Port 2 source MAC address")
+# parser.add_argument("--p2_dst_mac",
+# help="Port 2 destination MAC address")
+ parser.add_argument("--p2_src_start_ip", required=True,
+ help="Port 2 source start IP address")
+ parser.add_argument("--p2_src_end_ip",
+ default=False,
+ help="Port 2 source end IP address")
+ parser.add_argument("--p2_dst_start_ip", required=True,
+ help="Port 2 destination start IP address")
+ parser.add_argument("--p2_dst_end_ip",
+ default=False,
+ help="Port 2 destination end IP address")
+
+ return parser.parse_args()
+
+
+def main():