MCPcopy
hub / github.com/dreadl0ck/netcap / CaptureInfo

Method CaptureInfo

reassembly/reassembly_object.go:59–75  ·  view source on GitHub ↗

CaptureInfo returns the gopacket.CaptureInfo for the supplied offset.

(offset int)

Source from the content-addressed store, hash-verified

57
58// CaptureInfo returns the gopacket.CaptureInfo for the supplied offset.
59func (rl *reassemblyObject) CaptureInfo(offset int) gopacket.CaptureInfo {
60 if offset < 0 {
61 return gopacket.CaptureInfo{}
62 }
63
64 current := 0
65 for _, r := range rl.all {
66 if current+r.length() > offset {
67 return r.captureInfo()
68 }
69
70 current += r.length()
71 }
72
73 // Invalid offset
74 return gopacket.CaptureInfo{}
75}
76
77// Info returns information about the reassemblyObject.
78func (rl *reassemblyObject) Info() (TCPFlowDirection, bool, bool, int) {

Callers 1

Calls 2

lengthMethod · 0.65
captureInfoMethod · 0.65

Tested by 1