global: regroup all imports

This commit is contained in:
Jason A. Donenfeld 2019-05-14 09:09:52 +02:00
parent 3147f00089
commit 3bf41b06ae
27 changed files with 70 additions and 44 deletions

View file

@ -7,8 +7,9 @@ package device
import (
"encoding/binary"
"golang.org/x/sys/windows"
"unsafe"
"golang.org/x/sys/windows"
)
const (

View file

@ -7,10 +7,11 @@ package device
import (
"errors"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"net"
"strings"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
)
const (

View file

@ -18,13 +18,14 @@ package device
import (
"errors"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/rwcancel"
"net"
"strconv"
"sync"
"syscall"
"unsafe"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/rwcancel"
)
const (

View file

@ -8,10 +8,11 @@ package device
import (
"crypto/hmac"
"crypto/rand"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/chacha20poly1305"
"sync"
"time"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/chacha20poly1305"
)
type CookieChecker struct {

View file

@ -6,12 +6,13 @@
package device
import (
"golang.zx2c4.com/wireguard/ratelimiter"
"golang.zx2c4.com/wireguard/tun"
"runtime"
"sync"
"sync/atomic"
"time"
"golang.zx2c4.com/wireguard/ratelimiter"
"golang.zx2c4.com/wireguard/tun"
)
const (

View file

@ -7,8 +7,9 @@ package device
import (
"encoding/hex"
"golang.org/x/crypto/blake2s"
"testing"
"golang.org/x/crypto/blake2s"
)
type KDFTest struct {

View file

@ -7,9 +7,10 @@ package device
import (
"crypto/cipher"
"golang.zx2c4.com/wireguard/replay"
"sync"
"time"
"golang.zx2c4.com/wireguard/replay"
)
/* Due to limitations in Go and /x/crypto there is currently

View file

@ -8,8 +8,9 @@
package device
import (
"golang.org/x/sys/unix"
"runtime"
"golang.org/x/sys/unix"
)
var fwmarkIoctl int

View file

@ -9,9 +9,10 @@ import (
"crypto/hmac"
"crypto/rand"
"crypto/subtle"
"hash"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/curve25519"
"hash"
)
/* KDF related functions.

View file

@ -7,12 +7,13 @@ package device
import (
"errors"
"sync"
"time"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/poly1305"
"golang.zx2c4.com/wireguard/tai64n"
"sync"
"time"
)
const (

View file

@ -9,6 +9,7 @@ import (
"crypto/subtle"
"encoding/hex"
"errors"
"golang.org/x/crypto/chacha20poly1305"
)

View file

@ -8,14 +8,15 @@ package device
import (
"bytes"
"encoding/binary"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"net"
"strconv"
"sync"
"sync/atomic"
"time"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
)
type QueueHandshakeElement struct {

View file

@ -8,13 +8,14 @@ package device
import (
"bytes"
"encoding/binary"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"net"
"sync"
"sync/atomic"
"time"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
)
/* Outbound flow

View file

@ -6,8 +6,9 @@
package device
import (
"golang.zx2c4.com/wireguard/tun"
"sync/atomic"
"golang.zx2c4.com/wireguard/tun"
)
const DefaultMTU = 1420

View file

@ -8,13 +8,14 @@ package device
import (
"bufio"
"fmt"
"golang.zx2c4.com/wireguard/ipc"
"io"
"net"
"strconv"
"strings"
"sync/atomic"
"time"
"golang.zx2c4.com/wireguard/ipc"
)
type IPCError struct {

View file

@ -10,11 +10,12 @@ package ipc
import (
"errors"
"fmt"
"golang.org/x/sys/unix"
"net"
"os"
"path"
"unsafe"
"golang.org/x/sys/unix"
)
var socketDirectory = "/var/run/wireguard"

View file

@ -8,11 +8,12 @@ package ipc
import (
"errors"
"fmt"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/rwcancel"
"net"
"os"
"path"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/rwcancel"
)
var socketDirectory = "/var/run/wireguard"

View file

@ -6,8 +6,9 @@
package ipc
import (
"github.com/Microsoft/go-winio"
"net"
"github.com/Microsoft/go-winio"
)
//TODO: replace these with actual standard windows error numbers from the win package

View file

@ -9,14 +9,15 @@ package main
import (
"fmt"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/ipc"
"golang.zx2c4.com/wireguard/tun"
"os"
"os/signal"
"runtime"
"strconv"
"syscall"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/ipc"
"golang.zx2c4.com/wireguard/tun"
)
const (

View file

@ -7,12 +7,13 @@ package main
import (
"fmt"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/ipc"
"os"
"os/signal"
"syscall"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/ipc"
"golang.zx2c4.com/wireguard/tun"
)

View file

@ -7,9 +7,10 @@ package rwcancel
import (
"errors"
"golang.org/x/sys/unix"
"os"
"syscall"
"golang.org/x/sys/unix"
)
func max(a, b int) int {

View file

@ -8,9 +8,10 @@ package tun
import (
"bytes"
"errors"
"golang.zx2c4.com/wireguard/tun"
"os"
"testing"
"golang.zx2c4.com/wireguard/tun"
)
/* Helpers for writing unit tests

View file

@ -7,13 +7,14 @@ package tun
import (
"fmt"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
"io/ioutil"
"net"
"os"
"syscall"
"unsafe"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
)
const utunControlName = "com.apple.net.utun_control"

View file

@ -9,12 +9,13 @@ import (
"bytes"
"errors"
"fmt"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
"net"
"os"
"syscall"
"unsafe"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
)
// _TUNSIFHEAD, value derived from sys/net/{if_tun,ioccom}.h

View file

@ -12,15 +12,16 @@ import (
"bytes"
"errors"
"fmt"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/rwcancel"
"net"
"os"
"sync"
"syscall"
"time"
"unsafe"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/rwcancel"
)
const (

View file

@ -7,13 +7,14 @@ package tun
import (
"fmt"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
"io/ioutil"
"net"
"os"
"syscall"
"unsafe"
"golang.org/x/net/ipv6"
"golang.org/x/sys/unix"
)
// Structure for iface mtu get/set ioctls

View file

@ -13,7 +13,7 @@ import (
)
var (
modnetshell = windows.NewLazySystemDLL("netshell.dll")
modnetshell = windows.NewLazySystemDLL("netshell.dll")
procHrRenameConnection = modnetshell.NewProc("HrRenameConnection")
)