Projects STRLCPY tun2socks Commits 46c04db2
🤬
  • ■ ■ ■ ■ ■ ■
    core/device/tun/tun_wireguard_linux.go
     1 +//go:build linux && !(amd64 || arm64)
     2 + 
     3 +package tun
     4 + 
     5 +import (
     6 + "unsafe"
     7 +)
     8 + 
     9 +const (
     10 + virtioNetHdrLen = int(unsafe.Sizeof(virtioNetHdr{}))
     11 + offset = virtioNetHdrLen + 0 /* NO_PI */
     12 + defaultMTU = 1500
     13 +)
     14 + 
     15 +// virtioNetHdr is defined in the kernel in include/uapi/linux/virtio_net.h. The
     16 +// kernel symbol is virtio_net_hdr.
     17 +type virtioNetHdr struct {
     18 + flags uint8
     19 + gsoType uint8
     20 + hdrLen uint16
     21 + gsoSize uint16
     22 + csumStart uint16
     23 + csumOffset uint16
     24 +}
     25 + 
  • ■ ■ ■ ■ ■
    core/device/tun/tun_wireguard_unix.go
    1  -//go:build unix
     1 +//go:build unix && !linux
    2 2   
    3 3  package tun
    4 4   
    5  -//nolint:all
    6 5  const (
    7 6   offset = 4 /* 4 bytes TUN_PI */
    8 7   defaultMTU = 1500
    skipped 2 lines
Please wait...
Page is in error, reload to recover