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")
)