mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Move network internal code to internal package
Utilities written to be common across IPv4/IPv6 are not planned to be available for public use. https://golang.org/doc/go1.4#internalpackages PiperOrigin-RevId: 356554862
This commit is contained in:
committed by
gVisor bot
parent
d0c0549e60
commit
18e993eb4f
@@ -46,7 +46,7 @@ go_test(
|
||||
library = ":arp",
|
||||
deps = [
|
||||
"//pkg/tcpip",
|
||||
"//pkg/tcpip/network/testutil",
|
||||
"//pkg/tcpip/network/internal/testutil",
|
||||
"//pkg/tcpip/stack",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/testutil"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/testutil"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
|
||||
+5
-2
@@ -22,7 +22,10 @@ go_library(
|
||||
"reassembler.go",
|
||||
"reassembler_list.go",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
visibility = [
|
||||
"//pkg/tcpip/network/ipv4:__pkg__",
|
||||
"//pkg/tcpip/network/ipv6:__pkg__",
|
||||
],
|
||||
deps = [
|
||||
"//pkg/log",
|
||||
"//pkg/sync",
|
||||
@@ -44,7 +47,7 @@ go_test(
|
||||
deps = [
|
||||
"//pkg/tcpip/buffer",
|
||||
"//pkg/tcpip/faketime",
|
||||
"//pkg/tcpip/network/testutil",
|
||||
"//pkg/tcpip/network/internal/testutil",
|
||||
"//pkg/tcpip/stack",
|
||||
"@com_github_google_go_cmp//cmp:go_default_library",
|
||||
],
|
||||
+1
-1
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/buffer"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/faketime"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/testutil"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/testutil"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
@@ -4,8 +4,16 @@ package(licenses = ["notice"])
|
||||
|
||||
go_library(
|
||||
name = "ip",
|
||||
srcs = ["duplicate_address_detection.go"],
|
||||
visibility = ["//visibility:public"],
|
||||
srcs = [
|
||||
"duplicate_address_detection.go",
|
||||
"generic_multicast_protocol.go",
|
||||
"stats.go",
|
||||
],
|
||||
visibility = [
|
||||
"//pkg/tcpip/network/arp:__pkg__",
|
||||
"//pkg/tcpip/network/ipv4:__pkg__",
|
||||
"//pkg/tcpip/network/ipv6:__pkg__",
|
||||
],
|
||||
deps = [
|
||||
"//pkg/sync",
|
||||
"//pkg/tcpip",
|
||||
@@ -16,7 +24,10 @@ go_library(
|
||||
go_test(
|
||||
name = "ip_x_test",
|
||||
size = "small",
|
||||
srcs = ["duplicate_address_detection_test.go"],
|
||||
srcs = [
|
||||
"duplicate_address_detection_test.go",
|
||||
"generic_multicast_protocol_test.go",
|
||||
],
|
||||
deps = [
|
||||
":ip",
|
||||
"//pkg/sync",
|
||||
|
||||
+2
-9
@@ -23,17 +23,10 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/sync"
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/faketime"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/ip"
|
||||
)
|
||||
|
||||
const (
|
||||
addr1 = tcpip.Address("\x01")
|
||||
addr2 = tcpip.Address("\x02")
|
||||
addr3 = tcpip.Address("\x03")
|
||||
addr4 = tcpip.Address("\x04")
|
||||
|
||||
maxUnsolicitedReportDelay = time.Second
|
||||
)
|
||||
const maxUnsolicitedReportDelay = time.Second
|
||||
|
||||
var _ ip.MulticastGroupProtocol = (*mockMulticastGroupProtocol)(nil)
|
||||
|
||||
@@ -10,7 +10,7 @@ go_library(
|
||||
],
|
||||
visibility = [
|
||||
"//pkg/tcpip/network/arp:__pkg__",
|
||||
"//pkg/tcpip/network/fragmentation:__pkg__",
|
||||
"//pkg/tcpip/network/internal/fragmentation:__pkg__",
|
||||
"//pkg/tcpip/network/ipv4:__pkg__",
|
||||
"//pkg/tcpip/network/ipv6:__pkg__",
|
||||
],
|
||||
@@ -1,29 +0,0 @@
|
||||
load("//tools:defs.bzl", "go_library", "go_test")
|
||||
|
||||
package(licenses = ["notice"])
|
||||
|
||||
go_library(
|
||||
name = "ip",
|
||||
srcs = [
|
||||
"generic_multicast_protocol.go",
|
||||
"stats.go",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/sync",
|
||||
"//pkg/tcpip",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "ip_test",
|
||||
size = "small",
|
||||
srcs = ["generic_multicast_protocol_test.go"],
|
||||
deps = [
|
||||
":ip",
|
||||
"//pkg/sync",
|
||||
"//pkg/tcpip",
|
||||
"//pkg/tcpip/faketime",
|
||||
"@com_github_google_go_cmp//cmp:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -17,9 +17,9 @@ go_library(
|
||||
"//pkg/tcpip/buffer",
|
||||
"//pkg/tcpip/header",
|
||||
"//pkg/tcpip/header/parse",
|
||||
"//pkg/tcpip/network/fragmentation",
|
||||
"//pkg/tcpip/network/hash",
|
||||
"//pkg/tcpip/network/ip",
|
||||
"//pkg/tcpip/network/internal/fragmentation",
|
||||
"//pkg/tcpip/network/internal/ip",
|
||||
"//pkg/tcpip/stack",
|
||||
],
|
||||
)
|
||||
@@ -40,8 +40,8 @@ go_test(
|
||||
"//pkg/tcpip/link/channel",
|
||||
"//pkg/tcpip/link/sniffer",
|
||||
"//pkg/tcpip/network/arp",
|
||||
"//pkg/tcpip/network/internal/testutil",
|
||||
"//pkg/tcpip/network/ipv4",
|
||||
"//pkg/tcpip/network/testutil",
|
||||
"//pkg/tcpip/stack",
|
||||
"//pkg/tcpip/transport/icmp",
|
||||
"//pkg/tcpip/transport/raw",
|
||||
@@ -59,7 +59,7 @@ go_test(
|
||||
library = ":ipv4",
|
||||
deps = [
|
||||
"//pkg/tcpip",
|
||||
"//pkg/tcpip/network/testutil",
|
||||
"//pkg/tcpip/network/internal/testutil",
|
||||
"//pkg/tcpip/stack",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/buffer"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/ip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/tcpip/buffer"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header/parse"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/fragmentation"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/hash"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/fragmentation"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/link/sniffer"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/arp"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/testutil"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/testutil"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/transport/icmp"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/transport/raw"
|
||||
|
||||
@@ -16,7 +16,7 @@ package ipv4
|
||||
|
||||
import (
|
||||
"gvisor.dev/gvisor/pkg/tcpip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/ip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/network/internal/ip"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||
)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user