2024-06-03 20:42:06 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
//go:build !linux
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"io"
|
2024-08-09 15:03:58 +00:00
|
|
|
"net/netip"
|
2024-06-03 20:42:06 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2024-08-09 15:03:58 +00:00
|
|
|
func getUDPConnKernelTimestamp() (io.ReadWriteCloser, error) {
|
2024-06-03 20:42:06 +00:00
|
|
|
return nil, errors.New("unimplemented")
|
|
|
|
}
|
|
|
|
|
2024-08-12 20:39:11 +00:00
|
|
|
func measureSTUNRTTKernel(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
2024-06-04 14:26:10 +00:00
|
|
|
return 0, errors.New("unimplemented")
|
2024-06-03 20:42:06 +00:00
|
|
|
}
|
|
|
|
|
2024-08-12 21:09:45 +00:00
|
|
|
func getProtocolSupportInfo(p protocol) protocolSupportInfo {
|
|
|
|
switch p {
|
|
|
|
case protocolSTUN:
|
|
|
|
return protocolSupportInfo{
|
|
|
|
kernelTS: false,
|
|
|
|
userspaceTS: true,
|
|
|
|
stableConn: true,
|
|
|
|
}
|
|
|
|
case protocolHTTPS:
|
|
|
|
return protocolSupportInfo{
|
|
|
|
kernelTS: false,
|
|
|
|
userspaceTS: true,
|
|
|
|
stableConn: true,
|
|
|
|
}
|
|
|
|
case protocolTCP:
|
|
|
|
return protocolSupportInfo{
|
|
|
|
kernelTS: true,
|
|
|
|
userspaceTS: false,
|
|
|
|
stableConn: true,
|
|
|
|
}
|
2024-09-04 15:36:47 +00:00
|
|
|
case protocolICMP:
|
|
|
|
return protocolSupportInfo{
|
|
|
|
kernelTS: false,
|
|
|
|
userspaceTS: false,
|
|
|
|
stableConn: false,
|
|
|
|
}
|
2024-08-12 21:09:45 +00:00
|
|
|
}
|
|
|
|
return protocolSupportInfo{}
|
2024-06-03 20:42:06 +00:00
|
|
|
}
|
2024-08-12 20:39:11 +00:00
|
|
|
|
2024-09-04 15:36:47 +00:00
|
|
|
func getICMPConn(forDst netip.Addr, source timestampSource) (io.ReadWriteCloser, error) {
|
|
|
|
return nil, errors.New("platform unsupported")
|
|
|
|
}
|
|
|
|
|
|
|
|
func mkICMPRTTFn(source timestampSource) func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
|
|
|
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
|
|
|
return 0, errors.New("platform unsupported")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-12 20:39:11 +00:00
|
|
|
func setSOReuseAddr(fd uintptr) error {
|
|
|
|
return nil
|
|
|
|
}
|