MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / compareSeqLink

Function compareSeqLink

pkg/filter/util.go:201–259  ·  view source on GitHub ↗
(lhs any, rhs any)

Source from the content-addressed store, hash-verified

199}
200
201func compareSeqLink(lhs any, rhs any) bool {
202 if lhs == nil || rhs == nil {
203 return false
204 }
205
206 switch v := lhs.(type) {
207 case string:
208 s, ok := rhs.(string)
209 if !ok {
210 return false
211 }
212 return strings.EqualFold(v, s)
213 case uint8:
214 n, ok := rhs.(uint8)
215 if !ok {
216 return false
217 }
218 return v == n
219 case uint16:
220 n, ok := rhs.(uint16)
221 if !ok {
222 return false
223 }
224 return v == n
225 case uint32:
226 n, ok := rhs.(uint32)
227 if !ok {
228 return false
229 }
230 return v == n
231 case uint64:
232 n, ok := rhs.(uint64)
233 if !ok {
234 return false
235 }
236 if v == n {
237 return true
238 }
239 case int:
240 n, ok := rhs.(int)
241 if !ok {
242 return false
243 }
244 return v == n
245 case uint:
246 n, ok := rhs.(uint)
247 if !ok {
248 return false
249 }
250 return v == n
251 case net.IP:
252 ip, ok := rhs.(net.IP)
253 if !ok {
254 return false
255 }
256 return v.Equal(ip)
257 }
258 return false

Callers 2

CompareSeqLinkFunction · 0.85
CompareSeqLinksFunction · 0.85

Calls 1

EqualMethod · 0.80

Tested by

no test coverage detected