Parse command line arguments. :return: The parsed arguments.
()
| 148 | |
| 149 | |
| 150 | def parse_args() -> argparse.Namespace: |
| 151 | '''Parse command line arguments. |
| 152 | :return: The parsed arguments. |
| 153 | ''' |
| 154 | parser = argparse.ArgumentParser(description=__doc__) |
| 155 | parser.add_argument("dest_host", help="Destination host to which to send the CLIENT_HELLO.") |
| 156 | parser.add_argument('dest_port', type=int, help="Destination port to which to send the CLIENT_HELLO.") |
| 157 | parser.add_argument( |
| 158 | '--split_size', |
| 159 | '-s', |
| 160 | type=int, |
| 161 | default=1100, |
| 162 | help="Size of each split packet. Default is 1100 bytes. " |
| 163 | "0 means no split, send the whole packet at once.") |
| 164 | parser.add_argument('--num_data_packets', '-d', type=int, default=2, help="Number of data packets to send. Default is 2.") |
| 165 | return parser.parse_args() |
| 166 | |
| 167 | |
| 168 | def main() -> int: |