Documentation
¶
Overview ¶
Package tun wraps the wg tunnel implementation and adds packet filters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { tun.Device InputPacketFilters []InputPacketFilter }
Device wraps wg tunnel device.
func CreateTUN ¶
func CreateTUN(iface string, mtu int, packetFilters ...InputPacketFilter) (*Device, error)
CreateTUN creates a Device with the provided name and MTU.
type InputPacketFilter ¶
type InputPacketFilter func(PacketHeader) bool
InputPacketFilter is the function for filtering the packets going through the wireguard tunnel.
func FilterAllExceptIP ¶
func FilterAllExceptIP(ip netip.Addr) InputPacketFilter
FilterAllExceptIP drops all packets that have the destination different from the ip specified.
Click to show internal directories.
Click to hide internal directories.