dialer

package
v0.3.1-rc.8 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultInterfaceName  = ""
	DefaultInterfaceIndex = 0
	DefaultRoutingMark    = 0 // maybe need root permission
	DefaultMarkSymbol     func(socket int32) bool
)

Functions

func DialContext

func DialContext(ctx context.Context, network, address string) (net.Conn, error)

func DialContextWithOptions

func DialContextWithOptions(ctx context.Context, network, address string, opts *Options) (net.Conn, error)

func LinuxMarkSymbol

func LinuxMarkSymbol(fd int32, mark int) error

func ListenContext

func ListenContext(ctx context.Context, network string, address string) (net.Listener, error)

func ListenPacket

func ListenPacket(network, address string) (net.PacketConn, error)

func ListenPacketWithOptions

func ListenPacketWithOptions(network, address string, opts *Options) (net.PacketConn, error)

Types

type Options

type Options struct {
	// InterfaceName is the name of interface/device to bind.
	// If a socket is bound to an interface, only packets received
	// from that particular interface are processed by the socket.
	InterfaceName string

	// InterfaceIndex is the index of interface/device to bind.
	// It is almost the same as InterfaceName except it uses the
	// index of the interface instead of the name.
	InterfaceIndex int

	// RoutingMark is the mark for each packet sent through this
	// socket. Changing the mark can be used for mark-based routing
	// without netfilter or for packet filtering.
	MarkSymbol func(socket int32) bool
}

Jump to

Keyboard shortcuts

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