Function
findEntryForProtocol
(proto string, srcIP net.IP, srcPort uint, dstIP net.IP, dstPort uint)
Source from the content-addressed store, hash-verified
| 35 | } |
| 36 | |
| 37 | func findEntryForProtocol(proto string, srcIP net.IP, srcPort uint, dstIP net.IP, dstPort uint) *Entry { |
| 38 | entries, err := Parse(proto) |
| 39 | if err != nil { |
| 40 | log.Warning("Error while searching for %s netstat entry: %s", proto, err) |
| 41 | return nil |
| 42 | } |
| 43 | |
| 44 | for _, entry := range entries { |
| 45 | if srcIP.Equal(entry.SrcIP) && srcPort == entry.SrcPort && dstIP.Equal(entry.DstIP) && dstPort == entry.DstPort { |
| 46 | return &entry |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | return nil |
| 51 | } |
Tested by
no test coverage detected