Enable capture on this packet-generator interface of at most n packets. If n < 0, this is no limit
(self)
| 221 | print("", file=f) |
| 222 | |
| 223 | def enable_capture(self): |
| 224 | """Enable capture on this packet-generator interface |
| 225 | of at most n packets. |
| 226 | If n < 0, this is no limit |
| 227 | """ |
| 228 | # disable the capture to flush the capture |
| 229 | self.disable_capture() |
| 230 | self.remove_old_pcap_file(self.out_path) |
| 231 | # FIXME this should be an API, but no such exists atm |
| 232 | self.test.vapi.cli(self.capture_cli) |
| 233 | self._pcap_reader = None |
| 234 | |
| 235 | def disable_capture(self): |
| 236 | self.test.vapi.cli("%s disable" % self.capture_cli) |