mirror of
https://github.com/netbirdio/wireguard-go.git
synced 2026-05-22 17:08:51 -07:00
Use existing interface
This commit is contained in:
@@ -14,3 +14,5 @@ var (
|
||||
// is not thread safe and should only be modified during init.
|
||||
ControlFns = &controlFns
|
||||
)
|
||||
|
||||
type BatchReader = batchReader
|
||||
|
||||
@@ -3,15 +3,8 @@ package conn
|
||||
import (
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
// PacketReader abstracts ipv4.PacketConn and ipv6.PacketConn which both implement ReadBatch
|
||||
type PacketReader interface {
|
||||
ReadBatch([]ipv6.Message, int) (int, error)
|
||||
}
|
||||
|
||||
type ReceiverCreator interface {
|
||||
CreateReceiverFn(pc PacketReader, conn *net.UDPConn, rxOffload bool, msgPool *sync.Pool) ReceiveFunc
|
||||
CreateReceiverFn(pc BatchReader, conn *net.UDPConn, rxOffload bool, msgPool *sync.Pool) ReceiveFunc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user