global: begin modularization

This commit is contained in:
Jason A. Donenfeld
2019-03-03 05:00:40 +01:00
parent d435be35ca
commit 69f0fe67b6
44 changed files with 118 additions and 109 deletions
+4 -4
View File
@@ -24,10 +24,10 @@ MAKEFLAGS += --no-print-directory
generate-version-and-build:
@export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \
tag="$$(git describe --dirty 2>/dev/null)" && \
ver="$$(printf 'package main\nconst WireGuardGoVersion = "%s"\n' "$$tag")" && \
[ "$$(cat version.go 2>/dev/null)" != "$$ver" ] && \
echo "$$ver" > version.go && \
git update-index --assume-unchanged version.go || true
ver="$$(printf 'package device\nconst WireGuardGoVersion = "%s"\n' "$$tag")" && \
[ "$$(cat device/version.go 2>/dev/null)" != "$$ver" ] && \
echo "$$ver" > device/version.go && \
git update-index --assume-unchanged device/version.go || true
@$(MAKE) wireguard-go
wireguard-go: $(wildcard *.go) $(wildcard */*.go)
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"errors"
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"math/rand"
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"math/rand"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import "errors"
+2 -2
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"errors"
@@ -177,4 +177,4 @@ func (device *Device) BindClose() error {
err := unsafeCloseBind(device)
device.net.Unlock()
return err
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"net"
+1 -1
View File
@@ -14,7 +14,7 @@
* So this code is remains platform dependent.
*/
package main
package device
import (
"errors"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"time"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"crypto/hmac"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"testing"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"golang.zx2c4.com/wireguard/ratelimiter"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
/* Create two device instances and simulate full WireGuard interaction
* without network dependencies
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"math/rand"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"crypto/rand"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"net"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"encoding/hex"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"crypto/cipher"
+1 -1
View File
@@ -3,7 +3,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
import (
"io"
+1 -1
View File
@@ -5,7 +5,7 @@
* Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
*/
package main
package device
func (bind *NativeBind) SetMark(mark uint32) error {
return nil

Some files were not shown because too many files have changed in this diff Show More