Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
rewrite gvisor.dev imports to inet.af/netstack
Browse files Browse the repository at this point in the history
  • Loading branch information
bradfitz committed Jun 22, 2021
1 parent 9aad624 commit 0407d1a
Show file tree
Hide file tree
Showing 144 changed files with 423 additions and 408 deletions.
2 changes: 1 addition & 1 deletion atomicbitops/atomicbitops_32bit_unsafe_state_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package atomicbitops

import (
"gvisor.dev/gvisor/pkg/state"
"inet.af/netstack/state"
)

func (aa *AlignedAtomicInt64) StateTypeName() string {
Expand Down
2 changes: 1 addition & 1 deletion atomicbitops/atomicbitops_64bit_state_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package atomicbitops

import (
"gvisor.dev/gvisor/pkg/state"
"inet.af/netstack/state"
)

func (aa *AlignedAtomicInt64) StateTypeName() string {
Expand Down
2 changes: 1 addition & 1 deletion buffer/buffer_state_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package buffer

import (
"gvisor.dev/gvisor/pkg/state"
"inet.af/netstack/state"
)

func (b *buffer) StateTypeName() string {
Expand Down
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module inet.af/netstack

go 1.16

require (
github.com/google/btree v1.0.1
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 h1:Vv0JUPWTyeqUq42B2WJ1FeIDjjvGKoA2Ss+Ts0lAVbs=
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
2 changes: 1 addition & 1 deletion linewriter/linewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package linewriter
import (
"bytes"

"gvisor.dev/gvisor/pkg/sync"
"inet.af/netstack/sync"
)

// Writer is an io.Writer which buffers input, flushing
Expand Down
4 changes: 2 additions & 2 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import (
"sync/atomic"
"time"

"gvisor.dev/gvisor/pkg/linewriter"
"gvisor.dev/gvisor/pkg/sync"
"inet.af/netstack/linewriter"
"inet.af/netstack/sync"
)

// Level is the log level.
Expand Down
2 changes: 1 addition & 1 deletion rand/rand_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"io"

"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/sync"
"inet.af/netstack/sync"
)

// reader implements an io.Reader that returns pseudorandom bytes.
Expand Down
2 changes: 1 addition & 1 deletion sleep/sleep_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import (
"sync/atomic"
"unsafe"

"gvisor.dev/gvisor/pkg/sync"
"inet.af/netstack/sync"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions state/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"math"
"reflect"

"gvisor.dev/gvisor/pkg/log"
"gvisor.dev/gvisor/pkg/state/wire"
"inet.af/netstack/log"
"inet.af/netstack/state/wire"
)

// internalCallback is a interface called on object completion.
Expand Down
2 changes: 1 addition & 1 deletion state/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"reflect"
"sort"

"gvisor.dev/gvisor/pkg/state/wire"
"inet.af/netstack/state/wire"
)

// objectEncodeState the type and identity of an object occupying a memory
Expand Down
2 changes: 1 addition & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (
"reflect"
"runtime"

"gvisor.dev/gvisor/pkg/state/wire"
"inet.af/netstack/state/wire"
)

// objectID is a unique identifier assigned to each object to be serialized.
Expand Down
2 changes: 1 addition & 1 deletion state/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"reflect"
"sort"

"gvisor.dev/gvisor/pkg/state/wire"
"inet.af/netstack/state/wire"
)

// assertValidType asserts that the type is valid.
Expand Down
2 changes: 1 addition & 1 deletion state/wire/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"io"
"math"

"gvisor.dev/gvisor/pkg/gohacks"
"inet.af/netstack/gohacks"
)

// Reader is the required reader interface.
Expand Down
2 changes: 1 addition & 1 deletion sync/checklocks_on_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"
"unsafe"

"gvisor.dev/gvisor/pkg/goid"
"inet.af/netstack/goid"
)

// gLocks contains metadata about the locks held by a goroutine.
Expand Down
2 changes: 1 addition & 1 deletion sync/gate_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sync/atomic"
"unsafe"

"gvisor.dev/gvisor/pkg/gohacks"
"inet.af/netstack/gohacks"
)

// Gate is a synchronization primitive that allows concurrent goroutines to
Expand Down
14 changes: 7 additions & 7 deletions tcpip/adapters/gonet/gonet.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"net"
"time"

"gvisor.dev/gvisor/pkg/sync"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/buffer"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
"gvisor.dev/gvisor/pkg/tcpip/transport/udp"
"gvisor.dev/gvisor/pkg/waiter"
"inet.af/netstack/sync"
"inet.af/netstack/tcpip"
"inet.af/netstack/tcpip/buffer"
"inet.af/netstack/tcpip/stack"
"inet.af/netstack/tcpip/transport/tcp"
"inet.af/netstack/tcpip/transport/udp"
"inet.af/netstack/waiter"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion tcpip/buffer/buffer_state_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package buffer

import (
"gvisor.dev/gvisor/pkg/state"
"inet.af/netstack/state"
)

func (vv *VectorisedView) StateTypeName() string {
Expand Down
2 changes: 1 addition & 1 deletion tcpip/faketime/faketime.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync"
"time"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

// NullClock implements a clock that never advances.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/arp.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions tcpip/header/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package header
import (
"encoding/binary"

"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/buffer"
"inet.af/netstack/tcpip"
"inet.af/netstack/tcpip/buffer"
)

func calculateChecksum(buf []byte, odd bool, initial uint32) (uint16, bool) {
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/header_state_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package header

import (
"gvisor.dev/gvisor/pkg/state"
"inet.af/netstack/state"
)

func (r *SACKBlock) StateTypeName() string {
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/icmpv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

// ICMPv4 represents an ICMPv4 header stored in a byte array.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/icmpv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

// ICMPv6 represents an ICMPv6 header stored in a byte array.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/igmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"time"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

// IGMP represents an IGMP header stored in a byte array.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package header

import (
"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/ipv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"time"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

// RFC 971 defines the fields of the IPv4 header on page 11 using the following
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/ipv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"encoding/binary"
"fmt"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions tcpip/header/ipv6_extension_headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"io"
"math"

"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/buffer"
"inet.af/netstack/tcpip"
"inet.af/netstack/tcpip/buffer"
)

// IPv6ExtensionHeaderIdentifier is an IPv6 extension header identifier.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/ipv6_fragment.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/mld.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"time"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/ndp_neighbor_advert.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package header

import "gvisor.dev/gvisor/pkg/tcpip"
import "inet.af/netstack/tcpip"

// NDPNeighborAdvert is an NDP Neighbor Advertisement message. It will
// only contain the body of an ICMPv6 packet.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/ndp_neighbor_solicit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package header

import "gvisor.dev/gvisor/pkg/tcpip"
import "inet.af/netstack/tcpip"

// NDPNeighborSolicit is an NDP Neighbor Solicitation message. It will only
// contain the body of an ICMPv6 packet.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/ndp_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"math"
"time"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

// ndpOptionIdentifier is an NDP option type identifier.
Expand Down
8 changes: 4 additions & 4 deletions tcpip/header/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package parse
import (
"fmt"

"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/buffer"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"inet.af/netstack/tcpip"
"inet.af/netstack/tcpip/buffer"
"inet.af/netstack/tcpip/header"
"inet.af/netstack/tcpip/stack"
)

// ARP populates pkt's network header with an ARP header found in
Expand Down
4 changes: 2 additions & 2 deletions tcpip/header/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"encoding/binary"

"github.com/google/btree"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/seqnum"
"inet.af/netstack/tcpip"
"inet.af/netstack/tcpip/seqnum"
)

// These constants are the offsets of the respective fields in the TCP header.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/header/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"encoding/binary"
"math"

"gvisor.dev/gvisor/pkg/tcpip"
"inet.af/netstack/tcpip"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions tcpip/link/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ package channel
import (
"context"

"gvisor.dev/gvisor/pkg/sync"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"inet.af/netstack/sync"
"inet.af/netstack/tcpip"
"inet.af/netstack/tcpip/header"
"inet.af/netstack/tcpip/stack"
)

// PacketInfo holds all the information about an outbound packet.
Expand Down
2 changes: 1 addition & 1 deletion tcpip/link/channel/channel_state_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package channel

import (
"gvisor.dev/gvisor/pkg/state"
"inet.af/netstack/state"
)

func (n *NotificationHandle) StateTypeName() string {
Expand Down
Loading

0 comments on commit 0407d1a

Please sign in to comment.