summaryrefslogtreecommitdiffhomepage
path: root/bind_test.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-03 04:04:41 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-03 05:00:40 +0100
commit69f0fe67b63d90e523a5a1241fb1b46c2e8dbe03 (patch)
tree1ef86da3242afde462dcadb7241bb09f499d5bd7 /bind_test.go
parentd435be35cac49af9367b2005d831d55e570c4b1b (diff)
global: begin modularization
Diffstat (limited to 'bind_test.go')
-rw-r--r--bind_test.go55
1 files changed, 0 insertions, 55 deletions
diff --git a/bind_test.go b/bind_test.go
deleted file mode 100644
index c534646..0000000
--- a/bind_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-/* SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2017-2019 WireGuard LLC. All Rights Reserved.
- */
-
-package main
-
-import "errors"
-
-type DummyDatagram struct {
- msg []byte
- endpoint Endpoint
- world bool // better type
-}
-
-type DummyBind struct {
- in6 chan DummyDatagram
- ou6 chan DummyDatagram
- in4 chan DummyDatagram
- ou4 chan DummyDatagram
- closed bool
-}
-
-func (b *DummyBind) SetMark(v uint32) error {
- return nil
-}
-
-func (b *DummyBind) ReceiveIPv6(buff []byte) (int, Endpoint, error) {
- datagram, ok := <-b.in6
- if !ok {
- return 0, nil, errors.New("closed")
- }
- copy(buff, datagram.msg)
- return len(datagram.msg), datagram.endpoint, nil
-}
-
-func (b *DummyBind) ReceiveIPv4(buff []byte) (int, Endpoint, error) {
- datagram, ok := <-b.in4
- if !ok {
- return 0, nil, errors.New("closed")
- }
- copy(buff, datagram.msg)
- return len(datagram.msg), datagram.endpoint, nil
-}
-
-func (b *DummyBind) Close() error {
- close(b.in6)
- close(b.in4)
- b.closed = true
- return nil
-}
-
-func (b *DummyBind) Send(buff []byte, end Endpoint) error {
- return nil
-}