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

Class PcapNgWriter

scapy/utils.py:2656–2672  ·  view source on GitHub ↗

A stream pcapng writer with more control than wrpcapng()

Source from the content-addressed store, hash-verified

2654
2655
2656class PcapNgWriter(RawPcapNgWriter):
2657 """A stream pcapng writer with more control than wrpcapng()"""
2658
2659 def _get_time(self,
2660 packet, # type: Union[bytes, Packet]
2661 sec, # type: Optional[float]
2662 usec # type: Optional[int]
2663 ):
2664 # type: (...) -> Tuple[float, int]
2665 if hasattr(packet, "time"):
2666 if sec is None:
2667 sec = float(packet.time)
2668
2669 if usec is None:
2670 usec = 0
2671
2672 return sec, usec # type: ignore
2673
2674
2675@conf.commands.register

Callers 1

wrpcapngFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected