Documentation ¶
Index ¶
- Variables
- func DialContext(ctx context.Context, network, address string) (net.Conn, error)
- func DialContextWithOptions(ctx context.Context, network, address string, opts *Options) (net.Conn, error)
- func LinuxMarkSymbol(fd int32, mark int) error
- func ListenContext(ctx context.Context, network string, address string) (net.Listener, error)
- func ListenPacket(network, address string) (net.PacketConn, error)
- func ListenPacketWithOptions(network, address string, opts *Options) (net.PacketConn, error)
- type Options
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 DialContextWithOptions ¶
func LinuxMarkSymbol ¶
func ListenContext ¶
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 }
Click to show internal directories.
Click to hide internal directories.