tun

package
v0.0.0-...-ace1e11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

go:build linux

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAddress

func SetAddress(tunName, addr, mask string) error
Example
package main

import (
	"fmt"

	"github.com/penndev/socks5/core/tun"
)

func main() {
	fmt.Println(tun.SetAddress("socks5", "10.1.1.1", "255.255.255.255"))
}
Output:

exit status 1

func SetFilterIP

func SetFilterIP(action, addr, mask string) error

Types

type Tun

type Tun struct {
	*channel.Endpoint
	// contains filtered or unexported fields
}

func CreateTUN

func CreateTUN(ifname string, mtu int) (*Tun, error)

return stack.LinkEndpoint interface

func (*Tun) Attach

func (t *Tun) Attach(dispatcher stack.NetworkDispatcher)

func (*Tun) Close

func (t *Tun) Close() error

func (*Tun) Name

func (t *Tun) Name() string

func (*Tun) Read

func (t *Tun) Read(packet []byte) (int, error)

func (*Tun) Wait

func (t *Tun) Wait()

func (*Tun) Write

func (t *Tun) Write(packet []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL