(device string)
| 422 | } |
| 423 | |
| 424 | func pcapLookupnet(device string) (netp, maskp uint32, err error) { |
| 425 | err = LoadWinPCAP() |
| 426 | if err != nil { |
| 427 | return 0, 0, err |
| 428 | } |
| 429 | |
| 430 | buf := make([]byte, errorBufferSize) |
| 431 | dev, err := syscall.BytePtrFromString(device) |
| 432 | if err != nil { |
| 433 | return 0, 0, err |
| 434 | } |
| 435 | e, _, _ := syscall.Syscall6(pcapLookupnetPtr, 4, uintptr(unsafe.Pointer(dev)), uintptr(unsafe.Pointer(&netp)), uintptr(unsafe.Pointer(&maskp)), uintptr(unsafe.Pointer(&buf[0])), 0, 0) |
| 436 | if pcapCint(e) < 0 { |
| 437 | return 0, 0, errors.New(byteSliceToString(buf)) |
| 438 | } |
| 439 | return |
| 440 | } |
| 441 | |
| 442 | func (b *BPF) pcapOfflineFilter(ci gopacket.CaptureInfo, data []byte) bool { |
| 443 | var hdr pcapPkthdr |
nothing calls this directly
no test coverage detected
searching dependent graphs…