mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-03-31 10:47:35 +03:00
31 lines
546 B
Go
31 lines
546 B
Go
//go:build freebsd
|
|
|
|
package quic
|
|
|
|
import (
|
|
"net/netip"
|
|
"syscall"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
const (
|
|
msgTypeIPTOS = unix.IP_RECVTOS
|
|
ipv4PKTINFO = 0x7
|
|
)
|
|
|
|
const ecnIPv4DataLen = 1
|
|
|
|
const batchSize = 8
|
|
|
|
func parseIPv4PktInfo(body []byte) (ip netip.Addr, _ uint32, ok bool) {
|
|
// struct in_pktinfo {
|
|
// struct in_addr ipi_addr; /* Header Destination address */
|
|
// };
|
|
if len(body) != 4 {
|
|
return netip.Addr{}, 0, false
|
|
}
|
|
return netip.AddrFrom4(*(*[4]byte)(body)), 0, true
|
|
}
|
|
|
|
func isGSOSupported(syscall.RawConn) bool { return false }
|