MCPcopy Index your code
hub / github.com/secdev/scapy / wrpcapng

Function wrpcapng

scapy/utils.py:1286–1300  ·  view source on GitHub ↗

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
             )

Source from the content-addressed store, hash-verified

1284
1285@conf.commands.register
1286def 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

Callers

nothing calls this directly

Calls 2

PcapNgWriterClass · 0.85
writeMethod · 0.45

Tested by

no test coverage detected