iface

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package iface provides access to network connection operations via file descriptor. The implementation MUST be correct by inspection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnFile

type ConnFile interface {
	DupFile(tc *net.TCPConn) (*os.File, error)
}

ConnFile provides access to underlying network file.

type NetInfo

type NetInfo interface {
	GetUUID(fp *os.File) (string, error)
	GetBBRInfo(fp *os.File) (inetdiag.BBRInfo, error)
	GetTCPInfo(fp *os.File) (*tcp.LinuxTCPInfo, error)
}

NetInfo provides access to network connection metadata.

type RealConnInfo

type RealConnInfo struct{}

RealConnInfo implements both the ConnFile and NetInfo interfaces.

func (*RealConnInfo) DupFile

func (f *RealConnInfo) DupFile(tc *net.TCPConn) (*os.File, error)

DupFile returns the corresponding *os.File. Note that the returned *os.File is a dup() of the original, hence you now have ownership of two objects that you need to remember to defer Close() of.

func (*RealConnInfo) GetBBRInfo

func (f *RealConnInfo) GetBBRInfo(fp *os.File) (inetdiag.BBRInfo, error)

GetBBRInfo returns BBRInfo for the given file pointer.

func (*RealConnInfo) GetTCPInfo

func (f *RealConnInfo) GetTCPInfo(fp *os.File) (*tcp.LinuxTCPInfo, error)

GetTCPInfo returns TCPInfo for the given file pointer.

func (*RealConnInfo) GetUUID

func (f *RealConnInfo) GetUUID(fp *os.File) (string, error)

GetUUID returns a UUID for the given file pointer.

Jump to

Keyboard shortcuts

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