1
0
mirror of https://github.com/golang/go synced 2024-11-23 01:40:03 -07:00

all: update vendored golang.org/x/{net,tools} for Go 1.20 development

CL 421334 updated most of golang.org/x dependencies at the start of
the Go 1.20 development cycle. This CL updates x/net and x/tools as
well, now that go.dev/issue/54259 is resolved.

For #36905.
Updates #54259.

Change-Id: Ie422b71cba060a4774076eebf3b499cda1150367
Reviewed-on: https://go-review.googlesource.com/c/go/+/421461
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Dmitri Shuralyov 2022-08-04 21:39:53 -04:00 committed by Gopher Robot
parent 4fb7e22ade
commit 27f1246b85
83 changed files with 374 additions and 946 deletions

View File

@ -7,9 +7,9 @@ require (
golang.org/x/arch v0.0.0-20220722155209-00200b7164a7
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035
golang.org/x/tools v0.1.12-0.20220725193627-2a6393fe54b3
golang.org/x/tools v0.1.13-0.20220804200503-81c7dc4e4efa
)
require (

View File

@ -10,9 +10,9 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVD
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 h1:Y7NOhdqIOU8kYI7BxsgL38d0ot0raxvcW+EMQU2QrT4=
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/tools v0.1.12-0.20220725193627-2a6393fe54b3 h1:w/Sued0p1rtooa9ACDVKK2YXKdoowvAcSAMCg0uxOe4=
golang.org/x/tools v0.1.12-0.20220725193627-2a6393fe54b3/go.mod h1:LAN4g6CAevfxH/1ahTEeded+lrzLCK8eMwlRe2NVbGM=
golang.org/x/tools v0.1.13-0.20220804200503-81c7dc4e4efa h1:uKcci2q7Qtp6nMTC/AAvfNUAldFtJuHWV9/5QWiypts=
golang.org/x/tools v0.1.13-0.20220804200503-81c7dc4e4efa/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include -m32
// mkerrors.sh -Wall -Werror -static -I/tmp/386/include -m32
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && linux
// +build 386,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/386/include -m32 _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include -m64
// mkerrors.sh -Wall -Werror -static -I/tmp/amd64/include -m64
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && linux
// +build amd64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/amd64/include -m64 _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/arm/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && linux
// +build arm,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/arm/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char
// mkerrors.sh -Wall -Werror -static -I/tmp/arm64/include -fsigned-char
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && linux
// +build arm64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/loong64/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build loong64 && linux
// +build loong64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/loong64/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/mips/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips && linux
// +build mips,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/mips64/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && linux
// +build mips64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips64/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/mips64le/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64le && linux
// +build mips64le,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips64le/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/mipsle/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mipsle && linux
// +build mipsle,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/mipsle/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/ppc/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && linux
// +build ppc,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/ppc64/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && linux
// +build ppc64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/ppc64le/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64le && linux
// +build ppc64le,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64le/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/riscv64/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && linux
// +build riscv64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/riscv64/include _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char
// mkerrors.sh -Wall -Werror -static -I/tmp/s390x/include -fsigned-char
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build s390x && linux
// +build s390x,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char _const.go
package unix

View File

@ -1,11 +1,11 @@
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// mkerrors.sh -Wall -Werror -static -I/tmp/sparc64/include
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build sparc64 && linux
// +build sparc64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
// cgo -godefs -- -Wall -Werror -static -I/tmp/sparc64/include _const.go
package unix

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m32 /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/386/include -m32 /tmp/386/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m64 /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/amd64/include -m64 /tmp/amd64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/arm/include /tmp/arm/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/arm64/include -fsigned-char /tmp/arm64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/loong64/include /tmp/loong64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build loong64 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips/include /tmp/mips/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips64/include /tmp/mips64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips64le/include /tmp/mips64le/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64le && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mipsle/include /tmp/mipsle/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mipsle && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc/include /tmp/ppc/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc64/include /tmp/ppc64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc64le/include /tmp/ppc64le/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64le && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/riscv64/include /tmp/riscv64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/s390x/include -fsigned-char /tmp/s390x/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build s390x && linux

View File

@ -1,4 +1,4 @@
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/sparc64/include /tmp/sparc64/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build sparc64 && linux

View File

@ -1466,6 +1466,11 @@ const (
IFLA_ALT_IFNAME = 0x35
IFLA_PERM_ADDRESS = 0x36
IFLA_PROTO_DOWN_REASON = 0x37
IFLA_PARENT_DEV_NAME = 0x38
IFLA_PARENT_DEV_BUS_NAME = 0x39
IFLA_GRO_MAX_SIZE = 0x3a
IFLA_TSO_MAX_SIZE = 0x3b
IFLA_TSO_MAX_SEGS = 0x3c
IFLA_PROTO_DOWN_REASON_UNSPEC = 0x0
IFLA_PROTO_DOWN_REASON_MASK = 0x1
IFLA_PROTO_DOWN_REASON_VALUE = 0x2

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/386/cgo -- -Wall -Werror -static -I/tmp/386/include -m32 linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/amd64/cgo -- -Wall -Werror -static -I/tmp/amd64/include -m64 linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/arm/cgo -- -Wall -Werror -static -I/tmp/arm/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/arm64/cgo -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/loong64/cgo -- -Wall -Werror -static -I/tmp/loong64/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build loong64 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/mips/cgo -- -Wall -Werror -static -I/tmp/mips/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/mips64/cgo -- -Wall -Werror -static -I/tmp/mips64/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/mips64le/cgo -- -Wall -Werror -static -I/tmp/mips64le/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64le && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/mipsle/cgo -- -Wall -Werror -static -I/tmp/mipsle/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mipsle && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/ppc/cgo -- -Wall -Werror -static -I/tmp/ppc/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/ppc64/cgo -- -Wall -Werror -static -I/tmp/ppc64/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/ppc64le/cgo -- -Wall -Werror -static -I/tmp/ppc64le/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64le && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/riscv64/cgo -- -Wall -Werror -static -I/tmp/riscv64/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/s390x/cgo -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build s390x && linux

View File

@ -1,4 +1,4 @@
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// cgo -godefs -objdir=/tmp/sparc64/cgo -- -Wall -Werror -static -I/tmp/sparc64/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build sparc64 && linux

View File

@ -40,7 +40,7 @@ golang.org/x/mod/zip
# golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
## explicit
golang.org/x/sync/semaphore
# golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704
# golang.org/x/sys v0.0.0-20220804214406-8e32c043e418
## explicit; go 1.17
golang.org/x/sys/internal/unsafeheader
golang.org/x/sys/plan9
@ -49,7 +49,7 @@ golang.org/x/sys/windows
# golang.org/x/term v0.0.0-20220722155259-a9ba230a4035
## explicit; go 1.17
golang.org/x/term
# golang.org/x/tools v0.1.12-0.20220725193627-2a6393fe54b3
# golang.org/x/tools v0.1.13-0.20220804200503-81c7dc4e4efa
## explicit; go 1.18
golang.org/x/tools/cover
golang.org/x/tools/go/analysis

View File

@ -4,10 +4,10 @@ go 1.20
require (
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/net v0.0.0-20220517181318-183a9ca12b87
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48
)
require (
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 // indirect
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect
golang.org/x/text v0.3.8-0.20220722155301-d03b41800055 // indirect
)

View File

@ -1,8 +1,8 @@
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20220517181318-183a9ca12b87 h1:cCR+9mKLOGyX4Zx+uBZDXEDAQsvKQ/XbW4vreG5v1jU=
golang.org/x/net v0.0.0-20220517181318-183a9ca12b87/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704 h1:Y7NOhdqIOU8kYI7BxsgL38d0ot0raxvcW+EMQU2QrT4=
golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 h1:N9Vc/rorQUDes6B9CNdIxAn5jODGj2wzfrei2x4wNj4=
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.8-0.20220722155301-d03b41800055 h1:mr0sHTB/O2dJ0ivoAAz1Mqs776JzxylyunOKJws3B88=
golang.org/x/text v0.3.8-0.20220722155301-d03b41800055/go.mod h1:5O0TPrbzDRCcAYs9rc2W4CFPmVHJfNFe8tESfECPJPE=

View File

@ -859,7 +859,6 @@ func (p *http2clientConnPool) getStartDialLocked(ctx context.Context, addr strin
func (c *http2dialCall) dial(ctx context.Context, addr string) {
const singleUse = false // shared conn
c.res, c.err = c.p.t.dialClientConn(ctx, addr, singleUse)
close(c.done)
c.p.mu.Lock()
delete(c.p.dialing, addr)
@ -867,6 +866,8 @@ func (c *http2dialCall) dial(ctx context.Context, addr string) {
c.p.addConnLocked(addr, c.res)
}
c.p.mu.Unlock()
close(c.done)
}
// addConnIfNeeded makes a NewClientConn out of c if a connection for key doesn't
@ -1351,7 +1352,7 @@ const http2frameHeaderLen = 9
var http2padZeros = make([]byte, 255) // zeros for padding
// A FrameType is a registered frame type as defined in
// http://http2.github.io/http2-spec/#rfc.section.11.2
// https://httpwg.org/specs/rfc7540.html#rfc.section.11.2
type http2FrameType uint8
const (
@ -1474,7 +1475,7 @@ func http2typeFrameParser(t http2FrameType) http2frameParser {
// A FrameHeader is the 9 byte header of all HTTP/2 frames.
//
// See http://http2.github.io/http2-spec/#FrameHeader
// See https://httpwg.org/specs/rfc7540.html#FrameHeader
type http2FrameHeader struct {
valid bool // caller can access []byte fields in the Frame
@ -1906,7 +1907,7 @@ func (fr *http2Framer) checkFrameOrder(f http2Frame) error {
// A DataFrame conveys arbitrary, variable-length sequences of octets
// associated with a stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.1
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.1
type http2DataFrame struct {
http2FrameHeader
data []byte
@ -2029,7 +2030,7 @@ func (f *http2Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad
// endpoints communicate, such as preferences and constraints on peer
// behavior.
//
// See http://http2.github.io/http2-spec/#SETTINGS
// See https://httpwg.org/specs/rfc7540.html#SETTINGS
type http2SettingsFrame struct {
http2FrameHeader
p []byte
@ -2168,7 +2169,7 @@ func (f *http2Framer) WriteSettingsAck() error {
// A PingFrame is a mechanism for measuring a minimal round trip time
// from the sender, as well as determining whether an idle connection
// is still functional.
// See http://http2.github.io/http2-spec/#rfc.section.6.7
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.7
type http2PingFrame struct {
http2FrameHeader
Data [8]byte
@ -2201,7 +2202,7 @@ func (f *http2Framer) WritePing(ack bool, data [8]byte) error {
}
// A GoAwayFrame informs the remote peer to stop creating streams on this connection.
// See http://http2.github.io/http2-spec/#rfc.section.6.8
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.8
type http2GoAwayFrame struct {
http2FrameHeader
LastStreamID uint32
@ -2265,7 +2266,7 @@ func http2parseUnknownFrame(_ *http2frameCache, fh http2FrameHeader, countError
}
// A WindowUpdateFrame is used to implement flow control.
// See http://http2.github.io/http2-spec/#rfc.section.6.9
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.9
type http2WindowUpdateFrame struct {
http2FrameHeader
Increment uint32 // never read with high bit set
@ -2454,7 +2455,7 @@ func (f *http2Framer) WriteHeaders(p http2HeadersFrameParam) error {
}
// A PriorityFrame specifies the sender-advised priority of a stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.3
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.3
type http2PriorityFrame struct {
http2FrameHeader
http2PriorityParam
@ -2524,7 +2525,7 @@ func (f *http2Framer) WritePriority(streamID uint32, p http2PriorityParam) error
}
// A RSTStreamFrame allows for abnormal termination of a stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.4
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.4
type http2RSTStreamFrame struct {
http2FrameHeader
ErrCode http2ErrCode
@ -2556,7 +2557,7 @@ func (f *http2Framer) WriteRSTStream(streamID uint32, code http2ErrCode) error {
}
// A ContinuationFrame is used to continue a sequence of header block fragments.
// See http://http2.github.io/http2-spec/#rfc.section.6.10
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.10
type http2ContinuationFrame struct {
http2FrameHeader
headerFragBuf []byte
@ -2597,7 +2598,7 @@ func (f *http2Framer) WriteContinuation(streamID uint32, endHeaders bool, header
}
// A PushPromiseFrame is used to initiate a server stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.6
// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.6
type http2PushPromiseFrame struct {
http2FrameHeader
PromiseID uint32
@ -3268,14 +3269,14 @@ const (
http2ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
// SETTINGS_MAX_FRAME_SIZE default
// http://http2.github.io/http2-spec/#rfc.section.6.5.2
// https://httpwg.org/specs/rfc7540.html#rfc.section.6.5.2
http2initialMaxFrameSize = 16384
// NextProtoTLS is the NPN/ALPN protocol negotiated during
// HTTP/2's TLS setup.
http2NextProtoTLS = "h2"
// http://http2.github.io/http2-spec/#SettingValues
// https://httpwg.org/specs/rfc7540.html#SettingValues
http2initialHeaderTableSize = 4096
http2initialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size
@ -3324,7 +3325,7 @@ func (st http2streamState) String() string {
// Setting is a setting parameter: which setting it is, and its value.
type http2Setting struct {
// ID is which setting is being set.
// See http://http2.github.io/http2-spec/#SettingValues
// See https://httpwg.org/specs/rfc7540.html#SettingFormat
ID http2SettingID
// Val is the value.
@ -3356,7 +3357,7 @@ func (s http2Setting) Valid() error {
}
// A SettingID is an HTTP/2 setting as defined in
// http://http2.github.io/http2-spec/#iana-settings
// https://httpwg.org/specs/rfc7540.html#iana-settings
type http2SettingID uint16
const (
@ -4034,6 +4035,20 @@ type http2ServeConnOpts struct {
// requests. If nil, BaseConfig.Handler is used. If BaseConfig
// or BaseConfig.Handler is nil, http.DefaultServeMux is used.
Handler Handler
// UpgradeRequest is an initial request received on a connection
// undergoing an h2c upgrade. The request body must have been
// completely read from the connection before calling ServeConn,
// and the 101 Switching Protocols response written.
UpgradeRequest *Request
// Settings is the decoded contents of the HTTP2-Settings header
// in an h2c upgrade request.
Settings []byte
// SawClientPreface is set if the HTTP/2 connection preface
// has already been read from the connection.
SawClientPreface bool
}
func (o *http2ServeConnOpts) context() context.Context {
@ -4102,6 +4117,7 @@ func (s *http2Server) ServeConn(c net.Conn, opts *http2ServeConnOpts) {
headerTableSize: http2initialHeaderTableSize,
serveG: http2newGoroutineLock(),
pushEnabled: true,
sawClientPreface: opts.SawClientPreface,
}
s.state.registerConn(sc)
@ -4184,9 +4200,27 @@ func (s *http2Server) ServeConn(c net.Conn, opts *http2ServeConnOpts) {
}
}
if opts.Settings != nil {
fr := &http2SettingsFrame{
http2FrameHeader: http2FrameHeader{valid: true},
p: opts.Settings,
}
if err := fr.ForeachSetting(sc.processSetting); err != nil {
sc.rejectConn(http2ErrCodeProtocol, "invalid settings")
return
}
opts.Settings = nil
}
if hook := http2testHookGetServerConn; hook != nil {
hook(sc)
}
if opts.UpgradeRequest != nil {
sc.upgradeRequest(opts.UpgradeRequest)
opts.UpgradeRequest = nil
}
sc.serve()
}
@ -4231,6 +4265,7 @@ type http2serverConn struct {
// Everything following is owned by the serve loop; use serveG.check():
serveG http2goroutineLock // used to verify funcs are on serve()
pushEnabled bool
sawClientPreface bool // preface has already been read, used in h2c upgrade
sawFirstSettings bool // got the initial SETTINGS frame after the preface
needToSendSettingsAck bool
unackedSettings int // how many SETTINGS have we sent without ACKs?
@ -4698,6 +4733,9 @@ var http2errPrefaceTimeout = errors.New("timeout waiting for client preface")
// returns errPrefaceTimeout on timeout, or an error if the greeting
// is invalid.
func (sc *http2serverConn) readPreface() error {
if sc.sawClientPreface {
return nil
}
errc := make(chan error, 1)
go func() {
// Read the client preface
@ -5639,6 +5677,26 @@ func (sc *http2serverConn) processHeaders(f *http2MetaHeadersFrame) error {
return nil
}
func (sc *http2serverConn) upgradeRequest(req *Request) {
sc.serveG.check()
id := uint32(1)
sc.maxClientStreamID = id
st := sc.newStream(id, 0, http2stateHalfClosedRemote)
st.reqTrailer = req.Trailer
if st.reqTrailer != nil {
st.trailer = make(Header)
}
rw := sc.newResponseWriter(st, req)
// Disable any read deadline set by the net/http package
// prior to the upgrade.
if sc.hs.ReadTimeout != 0 {
sc.conn.SetReadDeadline(time.Time{})
}
go sc.runHandler(rw, req, sc.handler.ServeHTTP)
}
func (st *http2stream) processTrailerHeaders(f *http2MetaHeadersFrame) error {
sc := st.sc
sc.serveG.check()
@ -5869,6 +5927,11 @@ func (sc *http2serverConn) newWriterAndRequestNoBody(st *http2stream, rp http2re
}
req = req.WithContext(st.ctx)
rw := sc.newResponseWriter(st, req)
return rw, req, nil
}
func (sc *http2serverConn) newResponseWriter(st *http2stream, req *Request) *http2responseWriter {
rws := http2responseWriterStatePool.Get().(*http2responseWriterState)
bwSave := rws.bw
*rws = http2responseWriterState{} // zero all the fields
@ -5877,10 +5940,7 @@ func (sc *http2serverConn) newWriterAndRequestNoBody(st *http2stream, rp http2re
rws.bw.Reset(http2chunkWriter{rws})
rws.stream = st
rws.req = req
rws.body = body
rw := &http2responseWriter{rws: rws}
return rw, req, nil
return &http2responseWriter{rws: rws}
}
// Run on its own goroutine.
@ -6095,7 +6155,6 @@ type http2responseWriterState struct {
// immutable within a request:
stream *http2stream
req *Request
body *http2requestBody // to close at end of request, if DATA frames didn't
conn *http2serverConn
// TODO: adjust buffer writing sizes based on server config, frame size updates from peer, etc
@ -10782,16 +10841,15 @@ func (ws *http2priorityWriteScheduler) AdjustStream(streamID uint32, priority ht
func (ws *http2priorityWriteScheduler) Push(wr http2FrameWriteRequest) {
var n *http2priorityNode
if id := wr.StreamID(); id == 0 {
if wr.isControl() {
n = &ws.root
} else {
id := wr.StreamID()
n = ws.nodes[id]
if n == nil {
// id is an idle or closed stream. wr should not be a HEADERS or
// DATA frame. However, wr can be a RST_STREAM. In this case, we
// push wr onto the root, rather than creating a new priorityNode,
// since RST_STREAM is tiny and the stream's priority is unknown
// anyway. See issue #17919.
// DATA frame. In other case, we push wr onto the root, rather
// than creating a new priorityNode.
if wr.DataSize() > 0 {
panic("add DATA on non-open stream")
}

View File

@ -1,3 +0,0 @@
# This source code refers to The Go Authors for copyright purposes.
# The master list of authors is in the main Go distribution,
# visible at http://tip.golang.org/AUTHORS.

View File

@ -1,3 +0,0 @@
# This source code was written by the Go contributors.
# The master list of contributors is in the main Go distribution,
# visible at http://tip.golang.org/CONTRIBUTORS.

View File

@ -191,7 +191,7 @@ func appendTableSize(dst []byte, v uint32) []byte {
// bit prefix, to dst and returns the extended buffer.
//
// See
// http://http2.github.io/http2-spec/compression.html#integer.representation
// https://httpwg.org/specs/rfc7541.html#integer.representation
func appendVarInt(dst []byte, n byte, i uint64) []byte {
k := uint64((1 << n) - 1)
if i < k {

View File

@ -59,7 +59,7 @@ func (hf HeaderField) String() string {
// Size returns the size of an entry per RFC 7541 section 4.1.
func (hf HeaderField) Size() uint32 {
// http://http2.github.io/http2-spec/compression.html#rfc.section.4.1
// https://httpwg.org/specs/rfc7541.html#rfc.section.4.1
// "The size of the dynamic table is the sum of the size of
// its entries. The size of an entry is the sum of its name's
// length in octets (as defined in Section 5.2), its value's
@ -158,7 +158,7 @@ func (d *Decoder) SetAllowedMaxDynamicTableSize(v uint32) {
}
type dynamicTable struct {
// http://http2.github.io/http2-spec/compression.html#rfc.section.2.3.2
// https://httpwg.org/specs/rfc7541.html#rfc.section.2.3.2
table headerFieldTable
size uint32 // in bytes
maxSize uint32 // current maxSize
@ -307,27 +307,27 @@ func (d *Decoder) parseHeaderFieldRepr() error {
case b&128 != 0:
// Indexed representation.
// High bit set?
// http://http2.github.io/http2-spec/compression.html#rfc.section.6.1
// https://httpwg.org/specs/rfc7541.html#rfc.section.6.1
return d.parseFieldIndexed()
case b&192 == 64:
// 6.2.1 Literal Header Field with Incremental Indexing
// 0b10xxxxxx: top two bits are 10
// http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.1
// https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.1
return d.parseFieldLiteral(6, indexedTrue)
case b&240 == 0:
// 6.2.2 Literal Header Field without Indexing
// 0b0000xxxx: top four bits are 0000
// http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.2
// https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.2
return d.parseFieldLiteral(4, indexedFalse)
case b&240 == 16:
// 6.2.3 Literal Header Field never Indexed
// 0b0001xxxx: top four bits are 0001
// http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.3
// https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.3
return d.parseFieldLiteral(4, indexedNever)
case b&224 == 32:
// 6.3 Dynamic Table Size Update
// Top three bits are '001'.
// http://http2.github.io/http2-spec/compression.html#rfc.section.6.3
// https://httpwg.org/specs/rfc7541.html#rfc.section.6.3
return d.parseDynamicTableSizeUpdate()
}
@ -420,7 +420,7 @@ var errVarintOverflow = DecodingError{errors.New("varint integer overflow")}
// readVarInt reads an unsigned variable length integer off the
// beginning of p. n is the parameter as described in
// http://http2.github.io/http2-spec/compression.html#rfc.section.5.1.
// https://httpwg.org/specs/rfc7541.html#rfc.section.5.1.
//
// n must always be between 1 and 8.
//

View File

@ -169,25 +169,50 @@ func buildRootHuffmanNode() {
// AppendHuffmanString appends s, as encoded in Huffman codes, to dst
// and returns the extended buffer.
func AppendHuffmanString(dst []byte, s string) []byte {
rembits := uint8(8)
// This relies on the maximum huffman code length being 30 (See tables.go huffmanCodeLen array)
// So if a uint64 buffer has less than 32 valid bits can always accommodate another huffmanCode.
var (
x uint64 // buffer
n uint // number valid of bits present in x
)
for i := 0; i < len(s); i++ {
if rembits == 8 {
dst = append(dst, 0)
c := s[i]
n += uint(huffmanCodeLen[c])
x <<= huffmanCodeLen[c] % 64
x |= uint64(huffmanCodes[c])
if n >= 32 {
n %= 32 // Normally would be -= 32 but %= 32 informs compiler 0 <= n <= 31 for upcoming shift
y := uint32(x >> n) // Compiler doesn't combine memory writes if y isn't uint32
dst = append(dst, byte(y>>24), byte(y>>16), byte(y>>8), byte(y))
}
dst, rembits = appendByteToHuffmanCode(dst, rembits, s[i])
}
if rembits < 8 {
// special EOS symbol
code := uint32(0x3fffffff)
nbits := uint8(30)
t := uint8(code >> (nbits - rembits))
dst[len(dst)-1] |= t
// Add padding bits if necessary
if over := n % 8; over > 0 {
const (
eosCode = 0x3fffffff
eosNBits = 30
eosPadByte = eosCode >> (eosNBits - 8)
)
pad := 8 - over
x = (x << pad) | (eosPadByte >> over)
n += pad // 8 now divides into n exactly
}
return dst
// n in (0, 8, 16, 24, 32)
switch n / 8 {
case 0:
return dst
case 1:
return append(dst, byte(x))
case 2:
y := uint16(x)
return append(dst, byte(y>>8), byte(y))
case 3:
y := uint16(x >> 8)
return append(dst, byte(y>>8), byte(y), byte(x))
}
// case 4:
y := uint32(x)
return append(dst, byte(y>>24), byte(y>>16), byte(y>>8), byte(y))
}
// HuffmanEncodeLength returns the number of bytes required to encode
@ -199,35 +224,3 @@ func HuffmanEncodeLength(s string) uint64 {
}
return (n + 7) / 8
}
// appendByteToHuffmanCode appends Huffman code for c to dst and
// returns the extended buffer and the remaining bits in the last
// element. The appending is not byte aligned and the remaining bits
// in the last element of dst is given in rembits.
func appendByteToHuffmanCode(dst []byte, rembits uint8, c byte) ([]byte, uint8) {
code := huffmanCodes[c]
nbits := huffmanCodeLen[c]
for {
if rembits > nbits {
t := uint8(code << (rembits - nbits))
dst[len(dst)-1] |= t
rembits -= nbits
break
}
t := uint8(code >> (nbits - rembits))
dst[len(dst)-1] |= t
nbits -= rembits
rembits = 8
if nbits == 0 {
break
}
dst = append(dst, 0)
}
return dst, rembits
}

View File

@ -9,6 +9,7 @@ package lif
import (
"errors"
"syscall"
"unsafe"
)
@ -25,7 +26,7 @@ type Inet4Addr struct {
}
// Family implements the Family method of Addr interface.
func (a *Inet4Addr) Family() int { return sysAF_INET }
func (a *Inet4Addr) Family() int { return syscall.AF_INET }
// An Inet6Addr represents an internet address for IPv6.
type Inet6Addr struct {
@ -35,7 +36,7 @@ type Inet6Addr struct {
}
// Family implements the Family method of Addr interface.
func (a *Inet6Addr) Family() int { return sysAF_INET6 }
func (a *Inet6Addr) Family() int { return syscall.AF_INET6 }
// Addrs returns a list of interface addresses.
//
@ -62,7 +63,7 @@ func Addrs(af int, name string) ([]Addr, error) {
lifr.Name[i] = int8(ll.Name[i])
}
for _, ep := range eps {
ioc := int64(sysSIOCGLIFADDR)
ioc := int64(syscall.SIOCGLIFADDR)
err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifr))
if err != nil {
continue
@ -73,11 +74,11 @@ func Addrs(af int, name string) ([]Addr, error) {
continue
}
switch sa.Family {
case sysAF_INET:
case syscall.AF_INET:
a := &Inet4Addr{PrefixLen: l}
copy(a.IP[:], lifr.Lifru[4:8])
as = append(as, a)
case sysAF_INET6:
case syscall.AF_INET6:
a := &Inet6Addr{PrefixLen: l, ZoneID: int(nativeEndian.Uint32(lifr.Lifru[24:28]))}
copy(a.IP[:], lifr.Lifru[8:24])
as = append(as, a)

View File

@ -11,7 +11,9 @@
// The package supports Solaris 11 or above.
package lif
import "syscall"
import (
"syscall"
)
type endpoint struct {
af int
@ -25,12 +27,12 @@ func (ep *endpoint) close() error {
func newEndpoints(af int) ([]endpoint, error) {
var lastErr error
var eps []endpoint
afs := []int{sysAF_INET, sysAF_INET6}
if af != sysAF_UNSPEC {
afs := []int{syscall.AF_INET, syscall.AF_INET6}
if af != syscall.AF_UNSPEC {
afs = []int{af}
}
for _, af := range afs {
s, err := syscall.Socket(af, sysSOCK_DGRAM, 0)
s, err := syscall.Socket(af, syscall.SOCK_DGRAM, 0)
if err != nil {
lastErr = err
continue

View File

@ -7,7 +7,10 @@
package lif
import "unsafe"
import (
"syscall"
"unsafe"
)
// A Link represents logical data link information.
//
@ -30,22 +33,22 @@ func (ll *Link) fetch(s uintptr) {
for i := 0; i < len(ll.Name); i++ {
lifr.Name[i] = int8(ll.Name[i])
}
ioc := int64(sysSIOCGLIFINDEX)
ioc := int64(syscall.SIOCGLIFINDEX)
if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
ll.Index = int(nativeEndian.Uint32(lifr.Lifru[:4]))
}
ioc = int64(sysSIOCGLIFFLAGS)
ioc = int64(syscall.SIOCGLIFFLAGS)
if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
ll.Flags = int(nativeEndian.Uint64(lifr.Lifru[:8]))
}
ioc = int64(sysSIOCGLIFMTU)
ioc = int64(syscall.SIOCGLIFMTU)
if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
ll.MTU = int(nativeEndian.Uint32(lifr.Lifru[:4]))
}
switch ll.Type {
case sysIFT_IPV4, sysIFT_IPV6, sysIFT_6TO4:
case syscall.IFT_IPV4, syscall.IFT_IPV6, syscall.IFT_6TO4:
default:
ioc = int64(sysSIOCGLIFHWADDR)
ioc = int64(syscall.SIOCGLIFHWADDR)
if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
ll.Addr, _ = parseLinkAddr(lifr.Lifru[4:])
}
@ -75,7 +78,7 @@ func links(eps []endpoint, name string) ([]Link, error) {
lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
for _, ep := range eps {
lifn.Family = uint16(ep.af)
ioc := int64(sysSIOCGLIFNUM)
ioc := int64(syscall.SIOCGLIFNUM)
if err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifn)); err != nil {
continue
}
@ -90,7 +93,7 @@ func links(eps []endpoint, name string) ([]Link, error) {
} else {
nativeEndian.PutUint32(lifc.Lifcu[:], uint32(uintptr(unsafe.Pointer(&b[0]))))
}
ioc = int64(sysSIOCGLIFCONF)
ioc = int64(syscall.SIOCGLIFCONF)
if err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifc)); err != nil {
continue
}

View File

@ -3,14 +3,6 @@
package lif
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_INET6 = 0x1a
sysSOCK_DGRAM = 0x1
)
type sockaddrStorage struct {
Family uint16
X_ss_pad1 [6]int8
@ -25,37 +17,6 @@ const (
sysLIFC_ALLZONES = 0x8
sysLIFC_UNDER_IPMP = 0x10
sysLIFC_ENABLED = 0x20
sysSIOCGLIFADDR = -0x3f87968f
sysSIOCGLIFDSTADDR = -0x3f87968d
sysSIOCGLIFFLAGS = -0x3f87968b
sysSIOCGLIFMTU = -0x3f879686
sysSIOCGLIFNETMASK = -0x3f879683
sysSIOCGLIFMETRIC = -0x3f879681
sysSIOCGLIFNUM = -0x3ff3967e
sysSIOCGLIFINDEX = -0x3f87967b
sysSIOCGLIFSUBNET = -0x3f879676
sysSIOCGLIFLNKINFO = -0x3f879674
sysSIOCGLIFCONF = -0x3fef965b
sysSIOCGLIFHWADDR = -0x3f879640
)
const (
sysIFF_UP = 0x1
sysIFF_BROADCAST = 0x2
sysIFF_DEBUG = 0x4
sysIFF_LOOPBACK = 0x8
sysIFF_POINTOPOINT = 0x10
sysIFF_NOTRAILERS = 0x20
sysIFF_RUNNING = 0x40
sysIFF_NOARP = 0x80
sysIFF_PROMISC = 0x100
sysIFF_ALLMULTI = 0x200
sysIFF_INTELLIGENT = 0x400
sysIFF_MULTICAST = 0x800
sysIFF_MULTI_BCAST = 0x1000
sysIFF_UNNUMBERED = 0x2000
sysIFF_PRIVATE = 0x8000
)
const (
@ -95,9 +56,3 @@ type lifIfinfoReq struct {
Reachretrans uint32
Maxmtu uint32
}
const (
sysIFT_IPV4 = 0xc8
sysIFT_IPV6 = 0xc9
sysIFT_6TO4 = 0xca
)

View File

@ -398,7 +398,11 @@ func checkForTimeoutError(t *testing.T, err error) {
t.Helper()
if nerr, ok := err.(net.Error); ok {
if !nerr.Timeout() {
t.Errorf("got error: %v, want err.Timeout() = true", nerr)
if runtime.GOOS == "windows" && runtime.GOARCH == "arm64" && t.Name() == "TestTestConn/TCP/RacyRead" {
t.Logf("ignoring known failure mode on windows/arm64; see https://go.dev/issue/52893")
} else {
t.Errorf("got error: %v, want err.Timeout() = true", nerr)
}
}
} else {
t.Errorf("got %T: %v, want net.Error", err, err)

View File

@ -7,7 +7,10 @@
package route
import "runtime"
import (
"runtime"
"syscall"
)
// An Addr represents an address associated with packet routing.
type Addr interface {
@ -23,7 +26,7 @@ type LinkAddr struct {
}
// Family implements the Family method of Addr interface.
func (a *LinkAddr) Family() int { return sysAF_LINK }
func (a *LinkAddr) Family() int { return syscall.AF_LINK }
func (a *LinkAddr) lenAndSpace() (int, int) {
l := 8 + len(a.Name) + len(a.Addr)
@ -40,7 +43,7 @@ func (a *LinkAddr) marshal(b []byte) (int, error) {
return 0, errInvalidAddr
}
b[0] = byte(l)
b[1] = sysAF_LINK
b[1] = syscall.AF_LINK
if a.Index > 0 {
nativeEndian.PutUint16(b[2:4], uint16(a.Index))
}
@ -62,7 +65,7 @@ func parseLinkAddr(b []byte) (Addr, error) {
if len(b) < 8 {
return nil, errInvalidAddr
}
_, a, err := parseKernelLinkAddr(sysAF_LINK, b[4:])
_, a, err := parseKernelLinkAddr(syscall.AF_LINK, b[4:])
if err != nil {
return nil, err
}
@ -122,7 +125,7 @@ type Inet4Addr struct {
}
// Family implements the Family method of Addr interface.
func (a *Inet4Addr) Family() int { return sysAF_INET }
func (a *Inet4Addr) Family() int { return syscall.AF_INET }
func (a *Inet4Addr) lenAndSpace() (int, int) {
return sizeofSockaddrInet, roundup(sizeofSockaddrInet)
@ -134,7 +137,7 @@ func (a *Inet4Addr) marshal(b []byte) (int, error) {
return 0, errShortBuffer
}
b[0] = byte(l)
b[1] = sysAF_INET
b[1] = syscall.AF_INET
copy(b[4:8], a.IP[:])
return ll, nil
}
@ -146,7 +149,7 @@ type Inet6Addr struct {
}
// Family implements the Family method of Addr interface.
func (a *Inet6Addr) Family() int { return sysAF_INET6 }
func (a *Inet6Addr) Family() int { return syscall.AF_INET6 }
func (a *Inet6Addr) lenAndSpace() (int, int) {
return sizeofSockaddrInet6, roundup(sizeofSockaddrInet6)
@ -158,7 +161,7 @@ func (a *Inet6Addr) marshal(b []byte) (int, error) {
return 0, errShortBuffer
}
b[0] = byte(l)
b[1] = sysAF_INET6
b[1] = syscall.AF_INET6
copy(b[8:24], a.IP[:])
if a.ZoneID > 0 {
nativeEndian.PutUint32(b[24:28], uint32(a.ZoneID))
@ -169,14 +172,14 @@ func (a *Inet6Addr) marshal(b []byte) (int, error) {
// parseInetAddr parses b as an internet address for IPv4 or IPv6.
func parseInetAddr(af int, b []byte) (Addr, error) {
switch af {
case sysAF_INET:
case syscall.AF_INET:
if len(b) < sizeofSockaddrInet {
return nil, errInvalidAddr
}
a := &Inet4Addr{}
copy(a.IP[:], b[4:8])
return a, nil
case sysAF_INET6:
case syscall.AF_INET6:
if len(b) < sizeofSockaddrInet6 {
return nil, errInvalidAddr
}
@ -245,7 +248,7 @@ func parseKernelInetAddr(af int, b []byte) (int, Addr, error) {
a := &Inet6Addr{}
copy(a.IP[:], b[off6:off6+16])
return int(b[0]), a, nil
case af == sysAF_INET6:
case af == syscall.AF_INET6:
a := &Inet6Addr{}
if l-1 < off6 {
copy(a.IP[:], b[1:l])
@ -365,15 +368,15 @@ func marshalAddrs(b []byte, as []Addr) (uint, error) {
}
func parseAddrs(attrs uint, fn func(int, []byte) (int, Addr, error), b []byte) ([]Addr, error) {
var as [sysRTAX_MAX]Addr
af := int(sysAF_UNSPEC)
for i := uint(0); i < sysRTAX_MAX && len(b) >= roundup(0); i++ {
var as [syscall.RTAX_MAX]Addr
af := int(syscall.AF_UNSPEC)
for i := uint(0); i < syscall.RTAX_MAX && len(b) >= roundup(0); i++ {
if attrs&(1<<i) == 0 {
continue
}
if i <= sysRTAX_BRD {
if i <= syscall.RTAX_BRD {
switch b[1] {
case sysAF_LINK:
case syscall.AF_LINK:
a, err := parseLinkAddr(b)
if err != nil {
return nil, err
@ -384,7 +387,7 @@ func parseAddrs(attrs uint, fn func(int, []byte) (int, Addr, error), b []byte) (
return nil, errMessageTooShort
}
b = b[l:]
case sysAF_INET, sysAF_INET6:
case syscall.AF_INET, syscall.AF_INET6:
af = int(b[1])
a, err := parseInetAddr(af, b)
if err != nil {

View File

@ -7,7 +7,10 @@
package route
import "runtime"
import (
"runtime"
"syscall"
)
func (w *wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < w.bodyOff {
@ -18,13 +21,13 @@ func (w *wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error)
return nil, errInvalidMessage
}
attrs := uint(nativeEndian.Uint32(b[4:8]))
if attrs&sysRTA_IFP == 0 {
if attrs&syscall.RTA_IFP == 0 {
return nil, nil
}
m := &InterfaceMessage{
Version: int(b[2]),
Type: int(b[3]),
Addrs: make([]Addr, sysRTAX_MAX),
Addrs: make([]Addr, syscall.RTAX_MAX),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[12:14])),
extOff: w.extOff,
@ -34,7 +37,7 @@ func (w *wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error)
if err != nil {
return nil, err
}
m.Addrs[sysRTAX_IFP] = a
m.Addrs[syscall.RTAX_IFP] = a
m.Name = a.(*LinkAddr).Name
return m, nil
}

View File

@ -4,9 +4,11 @@
package route
import "syscall"
func (w *wireFormat) parseInterfaceMessage(typ RIBType, b []byte) (Message, error) {
var extOff, bodyOff int
if typ == sysNET_RT_IFLISTL {
if typ == syscall.NET_RT_IFLISTL {
if len(b) < 20 {
return nil, errMessageTooShort
}
@ -24,7 +26,7 @@ func (w *wireFormat) parseInterfaceMessage(typ RIBType, b []byte) (Message, erro
return nil, errInvalidMessage
}
attrs := uint(nativeEndian.Uint32(b[4:8]))
if attrs&sysRTA_IFP == 0 {
if attrs&syscall.RTA_IFP == 0 {
return nil, nil
}
m := &InterfaceMessage{
@ -32,7 +34,7 @@ func (w *wireFormat) parseInterfaceMessage(typ RIBType, b []byte) (Message, erro
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[12:14])),
Addrs: make([]Addr, sysRTAX_MAX),
Addrs: make([]Addr, syscall.RTAX_MAX),
extOff: extOff,
raw: b[:l],
}
@ -40,14 +42,14 @@ func (w *wireFormat) parseInterfaceMessage(typ RIBType, b []byte) (Message, erro
if err != nil {
return nil, err
}
m.Addrs[sysRTAX_IFP] = a
m.Addrs[syscall.RTAX_IFP] = a
m.Name = a.(*LinkAddr).Name
return m, nil
}
func (w *wireFormat) parseInterfaceAddrMessage(typ RIBType, b []byte) (Message, error) {
var bodyOff int
if typ == sysNET_RT_IFLISTL {
if typ == syscall.NET_RT_IFLISTL {
if len(b) < 24 {
return nil, errMessageTooShort
}

View File

@ -4,6 +4,8 @@
package route
import "syscall"
func (*wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < 32 {
return nil, errMessageTooShort
@ -13,7 +15,7 @@ func (*wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
return nil, errInvalidMessage
}
attrs := uint(nativeEndian.Uint32(b[12:16]))
if attrs&sysRTA_IFP == 0 {
if attrs&syscall.RTA_IFP == 0 {
return nil, nil
}
m := &InterfaceMessage{
@ -21,7 +23,7 @@ func (*wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[16:20])),
Index: int(nativeEndian.Uint16(b[6:8])),
Addrs: make([]Addr, sysRTAX_MAX),
Addrs: make([]Addr, syscall.RTAX_MAX),
raw: b[:l],
}
ll := int(nativeEndian.Uint16(b[4:6]))
@ -32,7 +34,7 @@ func (*wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
if err != nil {
return nil, err
}
m.Addrs[sysRTAX_IFP] = a
m.Addrs[syscall.RTAX_IFP] = a
m.Name = a.(*LinkAddr).Name
return m, nil
}

View File

@ -111,7 +111,7 @@ func FetchRIB(af int, typ RIBType, arg int) ([]byte, error) {
try := 0
for {
try++
mib := [6]int32{sysCTL_NET, sysAF_ROUTE, 0, int32(af), int32(typ), int32(arg)}
mib := [6]int32{syscall.CTL_NET, syscall.AF_ROUTE, 0, int32(af), int32(typ), int32(arg)}
n := uintptr(0)
if err := sysctl(mib[:], nil, &n, nil, 0); err != nil {
return nil, os.NewSyscallError("sysctl", err)

View File

@ -4,14 +4,16 @@
package route
import "syscall"
import (
"syscall"
)
func (m *RouteMessage) marshal() ([]byte, error) {
l := sizeofRtMsghdr + addrsSpace(m.Addrs)
b := make([]byte, l)
nativeEndian.PutUint16(b[:2], uint16(l))
if m.Version == 0 {
b[2] = sysRTM_VERSION
b[2] = syscall.RTM_VERSION
} else {
b[2] = byte(m.Version)
}

View File

@ -7,7 +7,10 @@
package route
import "unsafe"
import (
"syscall"
"unsafe"
)
var (
nativeEndian binaryByteOrder
@ -25,7 +28,7 @@ func init() {
nativeEndian = bigEndian
}
// might get overridden in probeRoutingStack
rtmVersion = sysRTM_VERSION
rtmVersion = syscall.RTM_VERSION
kernelAlign, wireFormats = probeRoutingStack()
}

View File

@ -4,9 +4,11 @@
package route
import "syscall"
func (typ RIBType) parseable() bool {
switch typ {
case sysNET_RT_STAT, sysNET_RT_TRASH:
case syscall.NET_RT_STAT, syscall.NET_RT_TRASH:
return false
default:
return true
@ -66,22 +68,22 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
ifmam2.parse = ifmam2.parseInterfaceMulticastAddrMessage
// Darwin kernels require 32-bit aligned access to routing facilities.
return 4, map[int]*wireFormat{
sysRTM_ADD: rtm,
sysRTM_DELETE: rtm,
sysRTM_CHANGE: rtm,
sysRTM_GET: rtm,
sysRTM_LOSING: rtm,
sysRTM_REDIRECT: rtm,
sysRTM_MISS: rtm,
sysRTM_LOCK: rtm,
sysRTM_RESOLVE: rtm,
sysRTM_NEWADDR: ifam,
sysRTM_DELADDR: ifam,
sysRTM_IFINFO: ifm,
sysRTM_NEWMADDR: ifmam,
sysRTM_DELMADDR: ifmam,
sysRTM_IFINFO2: ifm2,
sysRTM_NEWMADDR2: ifmam2,
sysRTM_GET2: rtm2,
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_NEWMADDR: ifmam,
syscall.RTM_DELMADDR: ifmam,
syscall.RTM_IFINFO2: ifm2,
syscall.RTM_NEWMADDR2: ifmam2,
syscall.RTM_GET2: rtm2,
}
}

View File

@ -69,20 +69,20 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
}
return int(unsafe.Sizeof(p)), map[int]*wireFormat{
sysRTM_ADD: rtm,
sysRTM_DELETE: rtm,
sysRTM_CHANGE: rtm,
sysRTM_GET: rtm,
sysRTM_LOSING: rtm,
sysRTM_REDIRECT: rtm,
sysRTM_MISS: rtm,
sysRTM_LOCK: rtm,
sysRTM_RESOLVE: rtm,
sysRTM_NEWADDR: ifam,
sysRTM_DELADDR: ifam,
sysRTM_IFINFO: ifm,
sysRTM_NEWMADDR: ifmam,
sysRTM_DELMADDR: ifmam,
sysRTM_IFANNOUNCE: ifanm,
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_NEWMADDR: ifmam,
syscall.RTM_DELMADDR: ifmam,
syscall.RTM_IFANNOUNCE: ifanm,
}
}

View File

@ -141,20 +141,20 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage
ifanm.parse = ifanm.parseInterfaceAnnounceMessage
return align, map[int]*wireFormat{
sysRTM_ADD: rtm,
sysRTM_DELETE: rtm,
sysRTM_CHANGE: rtm,
sysRTM_GET: rtm,
sysRTM_LOSING: rtm,
sysRTM_REDIRECT: rtm,
sysRTM_MISS: rtm,
sysRTM_LOCK: rtm,
sysRTM_RESOLVE: rtm,
sysRTM_NEWADDR: ifam,
sysRTM_DELADDR: ifam,
sysRTM_IFINFO: ifm,
sysRTM_NEWMADDR: ifmam,
sysRTM_DELMADDR: ifmam,
sysRTM_IFANNOUNCE: ifanm,
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_NEWMADDR: ifmam,
syscall.RTM_DELMADDR: ifmam,
syscall.RTM_IFANNOUNCE: ifanm,
}
}

View File

@ -4,6 +4,8 @@
package route
import "syscall"
func (typ RIBType) parseable() bool { return true }
// RouteMetrics represents route metrics.
@ -54,18 +56,18 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
// NetBSD 6 and above kernels require 64-bit aligned access to
// routing facilities.
return 8, map[int]*wireFormat{
sysRTM_ADD: rtm,
sysRTM_DELETE: rtm,
sysRTM_CHANGE: rtm,
sysRTM_GET: rtm,
sysRTM_LOSING: rtm,
sysRTM_REDIRECT: rtm,
sysRTM_MISS: rtm,
sysRTM_LOCK: rtm,
sysRTM_RESOLVE: rtm,
sysRTM_NEWADDR: ifam,
sysRTM_DELADDR: ifam,
sysRTM_IFANNOUNCE: ifanm,
sysRTM_IFINFO: ifm,
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFANNOUNCE: ifanm,
syscall.RTM_IFINFO: ifm,
}
}

View File

@ -4,11 +4,14 @@
package route
import "unsafe"
import (
"syscall"
"unsafe"
)
func (typ RIBType) parseable() bool {
switch typ {
case sysNET_RT_STATS, sysNET_RT_TABLE:
case syscall.NET_RT_STATS, syscall.NET_RT_TABLE:
return false
default:
return true
@ -62,19 +65,18 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
ifanm := &wireFormat{extOff: -1, bodyOff: -1}
ifanm.parse = ifanm.parseInterfaceAnnounceMessage
return int(unsafe.Sizeof(p)), map[int]*wireFormat{
sysRTM_ADD: rtm,
sysRTM_DELETE: rtm,
sysRTM_CHANGE: rtm,
sysRTM_GET: rtm,
sysRTM_LOSING: rtm,
sysRTM_REDIRECT: rtm,
sysRTM_MISS: rtm,
sysRTM_LOCK: rtm,
sysRTM_RESOLVE: rtm,
sysRTM_NEWADDR: ifam,
sysRTM_DELADDR: ifam,
sysRTM_IFINFO: ifm,
sysRTM_IFANNOUNCE: ifanm,
sysRTM_DESYNC: rtm,
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_IFANNOUNCE: ifanm,
syscall.RTM_DESYNC: rtm,
}
}

View File

@ -3,83 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x1e
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_STAT = 0x4
sysNET_RT_TRASH = 0x5
sysNET_RT_IFLIST2 = 0x6
sysNET_RT_DUMP2 = 0x7
sysNET_RT_MAXID = 0xa
)
const (
sysCTL_MAXNAME = 0xc
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_MAXID = 0x9
)
const (
sysRTM_VERSION = 0x5
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_OLDADD = 0x9
sysRTM_OLDDEL = 0xa
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_NEWMADDR = 0xf
sysRTM_DELMADDR = 0x10
sysRTM_IFINFO2 = 0x12
sysRTM_NEWMADDR2 = 0x13
sysRTM_GET2 = 0x14
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_MAX = 0x8
)
const (
sizeofIfMsghdrDarwin15 = 0x70
sizeofIfaMsghdrDarwin15 = 0x14

View File

@ -3,84 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x1c
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_MAXID = 0x4
)
const (
sysCTL_MAXNAME = 0xc
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_P1003_1B = 0x9
sysCTL_LWKT = 0xa
sysCTL_MAXID = 0xb
)
const (
sysRTM_VERSION = 0x6
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_NEWMADDR = 0xf
sysRTM_DELMADDR = 0x10
sysRTM_IFANNOUNCE = 0x11
sysRTM_IEEE80211 = 0x12
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTA_MPLS1 = 0x100
sysRTA_MPLS2 = 0x200
sysRTA_MPLS3 = 0x400
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_MPLS1 = 0x8
sysRTAX_MPLS2 = 0x9
sysRTAX_MPLS3 = 0xa
sysRTAX_MAX = 0xb
)
const (
sizeofIfMsghdrDragonFlyBSD4 = 0xb0
sizeofIfaMsghdrDragonFlyBSD4 = 0x14

View File

@ -3,77 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x1c
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_IFMALIST = 0x4
sysNET_RT_IFLISTL = 0x5
)
const (
sysCTL_MAXNAME = 0x18
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_P1003_1B = 0x9
)
const (
sysRTM_VERSION = 0x5
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_NEWMADDR = 0xf
sysRTM_DELMADDR = 0x10
sysRTM_IFANNOUNCE = 0x11
sysRTM_IEEE80211 = 0x12
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_MAX = 0x8
)
const (
sizeofIfMsghdrlFreeBSD10 = 0x68
sizeofIfaMsghdrFreeBSD10 = 0x14

View File

@ -3,77 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x1c
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_IFMALIST = 0x4
sysNET_RT_IFLISTL = 0x5
)
const (
sysCTL_MAXNAME = 0x18
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_P1003_1B = 0x9
)
const (
sysRTM_VERSION = 0x5
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_NEWMADDR = 0xf
sysRTM_DELMADDR = 0x10
sysRTM_IFANNOUNCE = 0x11
sysRTM_IEEE80211 = 0x12
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_MAX = 0x8
)
const (
sizeofIfMsghdrlFreeBSD10 = 0xb0
sizeofIfaMsghdrFreeBSD10 = 0x14

View File

@ -3,77 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x1c
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_IFMALIST = 0x4
sysNET_RT_IFLISTL = 0x5
)
const (
sysCTL_MAXNAME = 0x18
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_P1003_1B = 0x9
)
const (
sysRTM_VERSION = 0x5
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_NEWMADDR = 0xf
sysRTM_DELMADDR = 0x10
sysRTM_IFANNOUNCE = 0x11
sysRTM_IEEE80211 = 0x12
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_MAX = 0x8
)
const (
sizeofIfMsghdrlFreeBSD10 = 0x68
sizeofIfaMsghdrFreeBSD10 = 0x14

View File

@ -3,77 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x1c
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_IFMALIST = 0x4
sysNET_RT_IFLISTL = 0x5
)
const (
sysCTL_MAXNAME = 0x18
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_P1003_1B = 0x9
)
const (
sysRTM_VERSION = 0x5
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_NEWMADDR = 0xf
sysRTM_DELMADDR = 0x10
sysRTM_IFANNOUNCE = 0x11
sysRTM_IEEE80211 = 0x12
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_MAX = 0x8
)
const (
sizeofIfMsghdrlFreeBSD10 = 0xb0
sizeofIfaMsghdrFreeBSD10 = 0x14

View File

@ -3,86 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x22
sysAF_LINK = 0x12
sysAF_INET6 = 0x18
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x5
sysNET_RT_MAXID = 0x6
)
const (
sysCTL_MAXNAME = 0xc
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_VFS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_USER = 0x8
sysCTL_DDB = 0x9
sysCTL_PROC = 0xa
sysCTL_VENDOR = 0xb
sysCTL_EMUL = 0xc
sysCTL_SECURITY = 0xd
sysCTL_MAXID = 0xe
)
const (
sysRTM_VERSION = 0x4
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_OLDADD = 0x9
sysRTM_OLDDEL = 0xa
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFANNOUNCE = 0x10
sysRTM_IEEE80211 = 0x11
sysRTM_SETGATE = 0x12
sysRTM_LLINFO_UPD = 0x13
sysRTM_IFINFO = 0x14
sysRTM_CHGADDR = 0x15
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTA_TAG = 0x100
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_TAG = 0x8
sysRTAX_MAX = 0x9
)
const (
sizeofIfMsghdrNetBSD7 = 0x98
sizeofIfaMsghdrNetBSD7 = 0x18

View File

@ -3,95 +3,6 @@
package route
const (
sysAF_UNSPEC = 0x0
sysAF_INET = 0x2
sysAF_ROUTE = 0x11
sysAF_LINK = 0x12
sysAF_INET6 = 0x18
sysSOCK_RAW = 0x3
sysNET_RT_DUMP = 0x1
sysNET_RT_FLAGS = 0x2
sysNET_RT_IFLIST = 0x3
sysNET_RT_STATS = 0x4
sysNET_RT_TABLE = 0x5
sysNET_RT_IFNAMES = 0x6
sysNET_RT_MAXID = 0x7
)
const (
sysCTL_MAXNAME = 0xc
sysCTL_UNSPEC = 0x0
sysCTL_KERN = 0x1
sysCTL_VM = 0x2
sysCTL_FS = 0x3
sysCTL_NET = 0x4
sysCTL_DEBUG = 0x5
sysCTL_HW = 0x6
sysCTL_MACHDEP = 0x7
sysCTL_DDB = 0x9
sysCTL_VFS = 0xa
sysCTL_MAXID = 0xb
)
const (
sysRTM_VERSION = 0x5
sysRTM_ADD = 0x1
sysRTM_DELETE = 0x2
sysRTM_CHANGE = 0x3
sysRTM_GET = 0x4
sysRTM_LOSING = 0x5
sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8
sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd
sysRTM_IFINFO = 0xe
sysRTM_IFANNOUNCE = 0xf
sysRTM_DESYNC = 0x10
sysRTM_INVALIDATE = 0x11
sysRTM_BFD = 0x12
sysRTM_PROPOSAL = 0x13
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
sysRTA_NETMASK = 0x4
sysRTA_GENMASK = 0x8
sysRTA_IFP = 0x10
sysRTA_IFA = 0x20
sysRTA_AUTHOR = 0x40
sysRTA_BRD = 0x80
sysRTA_SRC = 0x100
sysRTA_SRCMASK = 0x200
sysRTA_LABEL = 0x400
sysRTA_BFD = 0x800
sysRTA_DNS = 0x1000
sysRTA_STATIC = 0x2000
sysRTA_SEARCH = 0x4000
sysRTAX_DST = 0x0
sysRTAX_GATEWAY = 0x1
sysRTAX_NETMASK = 0x2
sysRTAX_GENMASK = 0x3
sysRTAX_IFP = 0x4
sysRTAX_IFA = 0x5
sysRTAX_AUTHOR = 0x6
sysRTAX_BRD = 0x7
sysRTAX_SRC = 0x8
sysRTAX_SRCMASK = 0x9
sysRTAX_LABEL = 0xa
sysRTAX_BFD = 0xb
sysRTAX_DNS = 0xc
sysRTAX_STATIC = 0xd
sysRTAX_SEARCH = 0xe
sysRTAX_MAX = 0xf
)
const (
sizeofRtMsghdr = 0x60

View File

@ -9,7 +9,7 @@ golang.org/x/crypto/curve25519/internal/field
golang.org/x/crypto/hkdf
golang.org/x/crypto/internal/poly1305
golang.org/x/crypto/internal/subtle
# golang.org/x/net v0.0.0-20220517181318-183a9ca12b87
# golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48
## explicit; go 1.17
golang.org/x/net/dns/dnsmessage
golang.org/x/net/http/httpguts
@ -19,7 +19,7 @@ golang.org/x/net/idna
golang.org/x/net/lif
golang.org/x/net/nettest
golang.org/x/net/route
# golang.org/x/sys v0.0.0-20220803195053-6e608f9ce704
# golang.org/x/sys v0.0.0-20220804214406-8e32c043e418
## explicit; go 1.17
golang.org/x/sys/cpu
# golang.org/x/text v0.3.8-0.20220722155301-d03b41800055