trireme-lib: Index | Files

package markedconn

import ""


Package Files

mark_linux.go markedconn.go origdest_linux.go platformdata.go

func DialMarkedWithContext Uses

func DialMarkedWithContext(ctx context.Context, network string, addr string, platformData *PlatformData, mark int) (net.Conn, error)

DialMarkedWithContext will dial a TCP connection to the provide address and mark the socket with the provided mark.

func GetInterfaces Uses

func GetInterfaces() map[string]struct{}

GetInterfaces retrieves all the local interfaces.

func NewSocketListener Uses

func NewSocketListener(ctx context.Context, port string, mark int) (net.Listener, error)

NewSocketListener will create a listener and mark the socket with the provided mark.

type PlatformData Uses

type PlatformData struct {
    // contains filtered or unexported fields

PlatformData is proxy/socket data (platform-specific)

func RemovePlatformData Uses

func RemovePlatformData(l net.Listener, conn net.Conn) *PlatformData

RemovePlatformData removes the data from storage and returns it

func TakePlatformData Uses

func TakePlatformData(l net.Listener, ip net.IP, port int) *PlatformData

TakePlatformData removes the data from storage and returns it

type PlatformDataControl Uses

type PlatformDataControl struct {

PlatformDataControl dummy impl PlatformDataControl is only needed for Windows now, and allows retrieval of kernel socket data.

func NewPlatformDataControl Uses

func NewPlatformDataControl() *PlatformDataControl

NewPlatformDataControl returns initialized PlatformDataControl

func (*PlatformDataControl) StorePlatformData Uses

func (n *PlatformDataControl) StorePlatformData(ip net.IP, port int, platformData *PlatformData)

StorePlatformData saves the data after GetDestInfo is called.

type ProxiedConnection Uses

type ProxiedConnection struct {
    // contains filtered or unexported fields

ProxiedConnection is a proxied connection where we can recover the original destination.

func (*ProxiedConnection) Close Uses

func (p *ProxiedConnection) Close() error

Close closes the connection.

func (*ProxiedConnection) GetOriginalDestination Uses

func (p *ProxiedConnection) GetOriginalDestination() (net.IP, int)

GetOriginalDestination sets the original destination of the connection.

func (*ProxiedConnection) GetPlatformData Uses

func (p *ProxiedConnection) GetPlatformData() *PlatformData

GetPlatformData gets the platform-specific socket data (needed for Windows)

func (*ProxiedConnection) GetTCPConnection Uses

func (p *ProxiedConnection) GetTCPConnection() *net.TCPConn

GetTCPConnection returns the TCP connection object.

func (*ProxiedConnection) LocalAddr Uses

func (p *ProxiedConnection) LocalAddr() net.Addr

LocalAddr implements the corresponding method of net.Conn, but returns the original address.

func (*ProxiedConnection) Read Uses

func (p *ProxiedConnection) Read(b []byte) (n int, err error)

Read reads data from the connection.

func (*ProxiedConnection) RemoteAddr Uses

func (p *ProxiedConnection) RemoteAddr() net.Addr

RemoteAddr returns the remote address

func (*ProxiedConnection) SetDeadline Uses

func (p *ProxiedConnection) SetDeadline(t time.Time) error

SetDeadline passes the read deadline to the original TCP connection.

func (*ProxiedConnection) SetReadDeadline Uses

func (p *ProxiedConnection) SetReadDeadline(t time.Time) error

SetReadDeadline implements the call by passing it to the original connection.

func (*ProxiedConnection) SetWriteDeadline Uses

func (p *ProxiedConnection) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements the call by passing it to the original connection.

func (*ProxiedConnection) Write Uses

func (p *ProxiedConnection) Write(b []byte) (n int, err error)

Write writes data to the connection.

type ProxiedListener Uses

type ProxiedListener struct {
    // contains filtered or unexported fields

ProxiedListener is a proxied listener that uses proxied connections.

func (ProxiedListener) Accept Uses

func (l ProxiedListener) Accept() (c net.Conn, err error)

Accept implements the accept method of the interface.

func (ProxiedListener) Addr Uses

func (l ProxiedListener) Addr() net.Addr

Addr implements the Addr method of net.Listener.

func (ProxiedListener) Close Uses

func (l ProxiedListener) Close() error

Close implements the Close method of the net.Listener.

Package markedconn imports 8 packages (graph) and is imported by 8 packages. Updated 2020-04-03. Refresh now. Tools for package owners.