Write a list of packets to a pcapng file :param filename: the name of the file to write packets to, or an open, writable file-like object. The file descriptor will be closed at the end of the call, so do not use an object you do not want to close (e.g., running wrpcapng(
(filename, # type: str
pkt, # type: _PacketIterable
)
| 1284 | |
| 1285 | @conf.commands.register |
| 1286 | def wrpcapng(filename, # type: str |
| 1287 | pkt, # type: _PacketIterable |
| 1288 | ): |
| 1289 | # type: (...) -> None |
| 1290 | """Write a list of packets to a pcapng file |
| 1291 | |
| 1292 | :param filename: the name of the file to write packets to, or an open, |
| 1293 | writable file-like object. The file descriptor will be |
| 1294 | closed at the end of the call, so do not use an object you |
| 1295 | do not want to close (e.g., running wrpcapng(sys.stdout, []) |
| 1296 | in interactive mode will crash Scapy). |
| 1297 | :param pkt: packets to write |
| 1298 | """ |
| 1299 | with PcapNgWriter(filename) as fdesc: |
| 1300 | fdesc.write(pkt) |
| 1301 | |
| 1302 | |
| 1303 | @conf.commands.register |
nothing calls this directly
no test coverage detected