Create input packet stream :param list packet_sizes: Required packet sizes.
(cls, packet_sizes, packet_count=test_packet_count)
| 90 | |
| 91 | @classmethod |
| 92 | def create_stream(cls, packet_sizes, packet_count=test_packet_count): |
| 93 | """Create input packet stream |
| 94 | |
| 95 | :param list packet_sizes: Required packet sizes. |
| 96 | """ |
| 97 | for i in range(0, packet_count): |
| 98 | info = cls.create_packet_info(cls.src_if, cls.src_if) |
| 99 | payload = cls.info_to_payload(info) |
| 100 | p = ( |
| 101 | Ether(dst=cls.src_if.local_mac, src=cls.src_if.remote_mac) |
| 102 | / IP( |
| 103 | id=info.index, src=cls.src_if.remote_ip4, dst=cls.dst_if.remote_ip4 |
| 104 | ) |
| 105 | / UDP(sport=1234, dport=5678) |
| 106 | / Raw(payload) |
| 107 | ) |
| 108 | size = packet_sizes[(i // 2) % len(packet_sizes)] |
| 109 | cls.extend_packet(p, size, cls.padding) |
| 110 | info.data = p |
| 111 | |
| 112 | @classmethod |
| 113 | def create_fragments(cls): |
no test coverage detected