MCPcopy Index your code
hub / github.com/google/gopacket / OpenOffline

Function OpenOffline

pcap/pcap.go:186–197  ·  view source on GitHub ↗

OpenOffline opens a file and returns its contents as a *Handle. Depending on libpcap support and on the timestamp resolution used in the file, nanosecond or microsecond resolution is used internally. All returned timestamps are scaled to nanosecond resolution. Resolution() can be used to query the a

(file string)

Source from the content-addressed store, hash-verified

184// internally. All returned timestamps are scaled to nanosecond resolution. Resolution() can be used
185// to query the actual resolution used.
186func OpenOffline(file string) (handle *Handle, err error) {
187 handle, err = openOffline(file)
188 if err != nil {
189 return
190 }
191 if pcapGetTstampPrecision(handle.cptr) == pcapTstampPrecisionNano {
192 handle.nanoSecsFactor = 1
193 } else {
194 handle.nanoSecsFactor = 1000
195 }
196 return
197}
198
199// OpenOfflineFile returns contents of input file as a *Handle. Depending on libpcap support and
200// on the timestamp resolution used in the file, nanosecond or microsecond resolution is used

Callers 14

mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
pcapInfoFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
TestPCAPGoWriteFunction · 0.85
TestPcapNonexistentFileFunction · 0.85
TestPcapFileReadFunction · 0.85
TestBPFFunction · 0.85
TestBPFInstructionFunction · 0.85

Calls 2

openOfflineFunction · 0.70
pcapGetTstampPrecisionFunction · 0.70

Tested by 7

TestPCAPGoWriteFunction · 0.68
TestPcapNonexistentFileFunction · 0.68
TestPcapFileReadFunction · 0.68
TestBPFFunction · 0.68
TestBPFInstructionFunction · 0.68
ExampleBPFFunction · 0.68
TestPCAPGoNgWriteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…