MCPcopy
hub / github.com/google/gopacket / NewWriter

Function NewWriter

pcapgo/write.go:74–76  ·  view source on GitHub ↗

NewWriter returns a new writer object, for writing packet data out to the given writer. If this is a new empty writer (as opposed to an append), you must call WriteFileHeader before WritePacket. Packet timestamps are written witn microsecond precision. Write a new file: f, _ := os.Create("/tmp/fil

(w io.Writer)

Source from the content-addressed store, hash-verified

72// w2.WritePacket(gopacket.CaptureInfo{...}, data2)
73// f2.Close()
74func NewWriter(w io.Writer) *Writer {
75 return &Writer{w: w, tsScaler: nanosPerMicro}
76}
77
78// WriteFileHeader writes a file header out to the writer.
79// This must be called exactly once per output.

Callers 6

TestPCAPGoWriteFunction · 0.92
Example_captureEthernetFunction · 0.92
TestWriteHeaderFunction · 0.85
TestWritePacketFunction · 0.85
BenchmarkWritePacketFunction · 0.85
TestCaptureInfoErrorsFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestPCAPGoWriteFunction · 0.74
Example_captureEthernetFunction · 0.74
TestWriteHeaderFunction · 0.68
TestWritePacketFunction · 0.68
BenchmarkWritePacketFunction · 0.68
TestCaptureInfoErrorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…