{"modulePath":"github.com/celzero/firestack","version":"v0.0.0-20261126203528-ea10d50bc2a7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tunnel\n\n## Functions\n\n```go\nfunc NewGTunnel(pctx context.Context, fd, mtu int, l3 string, hdl netstack.GConnHandler) (t *gtunnel, rev netstack.GConnHandler, err error)\n```\nfd must be non-blocking.\n\n## Types\n\n```go\ntype Tunnel interface {\n\t// IsConnected indicates whether the tunnel is in a connected state.\n\tIsConnected() bool\n\t// Disconnect disconnects the tunnel.\n\tDisconnect()\n\t// Enabled checks if the tunnel is up and running.\n\tEnabled() bool\n\t// Mtu returns the current MTU of the tunnel (tun MTU).\n\tMtu() int32\n\t// Creates a new link using fd (tun device).\n\tSetLinkAndRoutes(fd, tunmtu, engine int) error\n\t// Unsets existing link and closes the fd (tun device).\n\tUnlink() error\n\t// Set or unset the pcap sink\n\tSetPcap(fpcap string) error\n\t// NIC, IP, TCP, UDP, and ICMP stats.\n\tStat() (*x.NetStat, error)\n}\n```\nTunnel represents a session on a TUN device.\n\n","path":"github.com/celzero/firestack/tunnel","name":"tunnel","synopsis":"","isRedistributable":true}
