mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-04 18:01:13 +01:00
24 lines
460 B
Go
24 lines
460 B
Go
package bind
|
|
|
|
import (
|
|
"net"
|
|
"sync"
|
|
|
|
"golang.org/x/net/ipv4"
|
|
wgConn "golang.zx2c4.com/wireguard/conn"
|
|
)
|
|
|
|
type receiverCreator struct {
|
|
iceBind *ICEBind
|
|
}
|
|
|
|
func newReceiverCreator(iceBind *ICEBind) receiverCreator {
|
|
return receiverCreator{
|
|
iceBind: iceBind,
|
|
}
|
|
}
|
|
|
|
func (rc receiverCreator) CreateIPv4ReceiverFn(msgPool *sync.Pool, pc *ipv4.PacketConn, conn *net.UDPConn) wgConn.ReceiveFunc {
|
|
return rc.iceBind.createIPv4ReceiverFn(msgPool, pc, conn)
|
|
}
|