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

Function wrerf

scapy/utils.py:2806–2825  ·  view source on GitHub ↗

Write a list of packets to a ERF 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 wrerf(sys.st

(filename,  # type: Union[IO[bytes], str]
          pkt,  # type: _PacketIterable
          *args,  # type: Any
          **kargs  # type: Any
          )

Source from the content-addressed store, hash-verified

2804
2805@conf.commands.register
2806def wrerf(filename, # type: Union[IO[bytes], str]
2807 pkt, # type: _PacketIterable
2808 *args, # type: Any
2809 **kargs # type: Any
2810 ):
2811 # type: (...) -> None
2812 """Write a list of packets to a ERF file
2813
2814 :param filename: the name of the file to write packets to, or an open,
2815 writable file-like object. The file descriptor will be
2816 closed at the end of the call, so do not use an object you
2817 do not want to close (e.g., running wrerf(sys.stdout, [])
2818 in interactive mode will crash Scapy).
2819 :param gz: set to 1 to save a gzipped capture
2820 :param append: append packets to the capture file instead of
2821 truncating it
2822 :param sync: do not bufferize writes to the capture file
2823 """
2824 with ERFEthernetWriter(filename, *args, **kargs) as fdesc:
2825 fdesc.write(pkt)
2826
2827
2828class ERFEthernetWriter(PcapWriter):

Callers

nothing calls this directly

Calls 2

ERFEthernetWriterClass · 0.85
writeMethod · 0.45

Tested by

no test coverage detected