Documentation
¶
Index ¶
- Constants
- func SetupTunAsEnclave() (*os.File, error)
- func SetupTunAsProxy() (*os.File, error)
- func ToggleNAT(toggle bool) error
- func TunToVsock(from io.ReadCloser, to io.WriteCloser, ch chan error, wg *sync.WaitGroup)
- func VsockToTun(from io.ReadCloser, to io.WriteCloser, ch chan error, wg *sync.WaitGroup)
Constants ¶
const ( On = true Off = false )
const (
DefaultPort = 1024
)
Variables ¶
This section is empty.
Functions ¶
func SetupTunAsEnclave ¶
SetupTunAsEnclave sets up a tun interface and returns a ready-to-use file descriptor.
func SetupTunAsProxy ¶
SetupTunAsProxy sets up a tun interface and returns a ready-to-use file descriptor.
func ToggleNAT ¶
ToggleNAT toggles our iptables NAT rules, which ensure that the enclave can talk to the Internet.
func TunToVsock ¶
func TunToVsock(from io.ReadCloser, to io.WriteCloser, ch chan error, wg *sync.WaitGroup)
TunToVsock forwards network packets from the tun device to our TCP-over-VSOCK connection. The function keeps on forwarding packets until we encounter an error or EOF. Errors (including EOF) are written to the given channel.
func VsockToTun ¶
func VsockToTun(from io.ReadCloser, to io.WriteCloser, ch chan error, wg *sync.WaitGroup)
VsockToTun forwards network packets from our TCP-over-VSOCK connection to the tun interface. The function keeps on forwarding packets until we encounter an error or EOF. Errors (including EOF) are written to the given channel.
Types ¶
This section is empty.