byteToTime converts bytes into a timestamp
(data []byte)
| 88 | // __kernel_timespec from linux/time_types.h |
| 89 | // can't use unix.Timespec which is old timespec that uses 32bit ints on 386 platform. |
| 90 | sec := *(*int64)(unsafe.Pointer(&data[0])) |
| 91 | nsec := *(*int64)(unsafe.Pointer(&data[8])) |
| 92 | return time.Unix(sec, nsec), nil |
| 93 | } |
| 94 | |
| 95 | func ioctlHWTimestampCaps(fd int, ifname string) (int32, error) { |
| 96 | var rxFilter int32 |
| 97 | |
| 98 | hw, err := unix.IoctlGetEthtoolTsInfo(fd, ifname) |
| 99 | if err != nil { |
searching dependent graphs…