CaptureInfo returns the gopacket.CaptureInfo for the supplied offset.
(offset int)
| 57 | |
| 58 | // CaptureInfo returns the gopacket.CaptureInfo for the supplied offset. |
| 59 | func (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. |
| 78 | func (rl *reassemblyObject) Info() (TCPFlowDirection, bool, bool, int) { |