Documentation ¶
Index ¶
- Constants
- type ChannelConn
- func (cc *ChannelConn) Close() error
- func (cc *ChannelConn) ReadFromUDPAddrPort(b []byte) (n int, addr netip.AddrPort, err error)
- func (cc *ChannelConn) SetReadDeadline(t time.Time) error
- func (cc *ChannelConn) Write(b []byte) (int, error)
- func (cc *ChannelConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error)
- type ToverSokBind
- func (b *ToverSokBind) BatchSize() int
- func (b *ToverSokBind) Close() error
- func (b *ToverSokBind) CloseConn(peer key.NodePublic)
- func (b *ToverSokBind) GetConn(peer key.NodePublic) *ChannelConn
- func (b *ToverSokBind) Open(uint16) (fns []conn.ReceiveFunc, fakePort uint16, err error)
- func (b *ToverSokBind) ParseEndpoint(s string) (conn.Endpoint, error)
- func (b *ToverSokBind) ReadFromConns(packets [][]byte, sizes []int, eps []conn.Endpoint) (n int, err error)
- func (b *ToverSokBind) Send(bufs [][]byte, ep conn.Endpoint) error
- func (b *ToverSokBind) SetMark(mark uint32) error
- type UserSpaceWireGuardController
- func (u *UserSpaceWireGuardController) Close()
- func (u *UserSpaceWireGuardController) ConnFor(node key.NodePublic) types.UDPConn
- func (u *UserSpaceWireGuardController) GetStats(publicKey key.NodePublic) (*toversok.WGStats, error)
- func (u *UserSpaceWireGuardController) RemovePeer(publicKey key.NodePublic) error
- func (u *UserSpaceWireGuardController) UpdatePeer(publicKey key.NodePublic, cfg toversok.PeerCfg) error
- type UserSpaceWireGuardHost
Constants ¶
View Source
const ChannelConnBufferSize = 16
View Source
const SendTimeout = time.Second * 30
View Source
const WGGOIPCAddPeer = `public_key=%s
replace_allowed_ips=true
allowed_ip=%s/32
allowed_ip=%s/128
endpoint=%s
`
View Source
const WGGOIPCDevSetup = `private_key=%s
`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelConn ¶
type ChannelConn struct {
// contains filtered or unexported fields
}
ChannelConn is a types.UDPConn based on two internal channels.
On the "frontend" (types.UDPConn) it supports SetReadDeadLine, as normal.
func (*ChannelConn) Close ¶
func (cc *ChannelConn) Close() error
func (*ChannelConn) ReadFromUDPAddrPort ¶
func (*ChannelConn) SetReadDeadline ¶
func (cc *ChannelConn) SetReadDeadline(t time.Time) error
func (*ChannelConn) WriteToUDPAddrPort ¶
type ToverSokBind ¶
type ToverSokBind struct {
// contains filtered or unexported fields
}
func (*ToverSokBind) BatchSize ¶
func (b *ToverSokBind) BatchSize() int
func (*ToverSokBind) Close ¶
func (b *ToverSokBind) Close() error
func (*ToverSokBind) CloseConn ¶
func (b *ToverSokBind) CloseConn(peer key.NodePublic)
func (*ToverSokBind) GetConn ¶
func (b *ToverSokBind) GetConn(peer key.NodePublic) *ChannelConn
func (*ToverSokBind) Open ¶
func (b *ToverSokBind) Open(uint16) (fns []conn.ReceiveFunc, fakePort uint16, err error)
func (*ToverSokBind) ParseEndpoint ¶
func (b *ToverSokBind) ParseEndpoint(s string) (conn.Endpoint, error)
func (*ToverSokBind) ReadFromConns ¶
func (b *ToverSokBind) ReadFromConns(packets [][]byte, sizes []int, eps []conn.Endpoint) (n int, err error)
ReadFromConns implements conn.ReceiveFunc
func (*ToverSokBind) SetMark ¶
func (b *ToverSokBind) SetMark(mark uint32) error
SetMark is used by wireguard-go to avoid routing loops. TODO: double-check
type UserSpaceWireGuardController ¶
type UserSpaceWireGuardController struct {
// contains filtered or unexported fields
}
func (*UserSpaceWireGuardController) Close ¶
func (u *UserSpaceWireGuardController) Close()
func (*UserSpaceWireGuardController) ConnFor ¶
func (u *UserSpaceWireGuardController) ConnFor(node key.NodePublic) types.UDPConn
func (*UserSpaceWireGuardController) GetStats ¶
func (u *UserSpaceWireGuardController) GetStats(publicKey key.NodePublic) (*toversok.WGStats, error)
func (*UserSpaceWireGuardController) RemovePeer ¶
func (u *UserSpaceWireGuardController) RemovePeer(publicKey key.NodePublic) error
func (*UserSpaceWireGuardController) UpdatePeer ¶
func (u *UserSpaceWireGuardController) UpdatePeer(publicKey key.NodePublic, cfg toversok.PeerCfg) error
type UserSpaceWireGuardHost ¶
type UserSpaceWireGuardHost struct {
// contains filtered or unexported fields
}
func NewUsrWGHost ¶
func NewUsrWGHost() *UserSpaceWireGuardHost
func (*UserSpaceWireGuardHost) Controller ¶
func (u *UserSpaceWireGuardHost) Controller(privateKey key.NodePrivate, addr4, addr6 netip.Prefix) (toversok.WireGuardController, error)
func (*UserSpaceWireGuardHost) Reset ¶
func (u *UserSpaceWireGuardHost) Reset() error
Click to show internal directories.
Click to hide internal directories.