package socktest

Import Path
	net/internal/socktest (on golang.org and go.dev)

Dependency Relation
	imports 3 packages, and imported by 0 packages

Involved Source Files
	d-> switch.go
	    switch_posix.go
	    switch_unix.go
	    sys_cloexec.go
	    sys_unix.go

Exported Type Names

type AfterFilter (func) An AfterFilter represents a socket system call filter after an execution of a system call. It will only be executed after a system call for a socket that has an entry in internal table. If the filter returns a non-nil error, the system call function returns the non-nil error.
type Filter (func) A Filter represents a socket system call filter. It will only be executed before a system call for a socket that has an entry in internal table. If the filter returns a non-nil error, the execution of system call will be canceled and the system call function returns the non-nil error. It can return a non-nil AfterFilter for filtering after the execution of the system call. func (*Switch).Set(t FilterType, f Filter)
type FilterType int A FilterType represents a filter type. func (*Switch).Set(t FilterType, f Filter) const FilterAccept const FilterClose const FilterConnect const FilterGetsockoptInt const FilterListen const FilterSocket
type Sockets (map) Sockets maps a socket descriptor to the status of socket. func (*Switch).Sockets() Sockets
type Stat (struct) A Stat represents a per-cookie socket statistics. AcceptFailed uint64 Accepted uint64 CloseFailed uint64 Closed uint64 ConnectFailed uint64 Connected uint64 Family int ListenFailed uint64 Listened uint64 OpenFailed uint64 Opened uint64 Protocol int Type int (T) String() string T : expvar.Var T : fmt.Stringer func (*Switch).Stats() []Stat
type Status (struct) A Status represents the status of a socket. Cookie Cookie Err error SocketErr error (T) String() string T : expvar.Var T : fmt.Stringer
type Switch (struct) A Switch represents a callpath point switch for socket system calls. (*T) Accept(s int) (ns int, sa syscall.Sockaddr, err error) (*T) Accept4(s, flags int) (ns int, sa syscall.Sockaddr, err error) (*T) Close(s int) (err error) (*T) Connect(s int, sa syscall.Sockaddr) (err error) (*T) GetsockoptInt(s, level, opt int) (soerr int, err error) (*T) Listen(s, backlog int) (err error) (*T) Set(t FilterType, f Filter) (*T) Socket(family, sotype, proto int) (s int, err error) (*T) Sockets() Sockets (*T) Stats() []Stat
Exported Values
const FilterAccept FilterType = 3 // for Accept, Accept4 or AcceptEx
const FilterClose FilterType = 5 // for Close or Closesocket
const FilterConnect FilterType = 1 // for Connect or ConnectEx
const FilterGetsockoptInt FilterType = 4 // for GetsockoptInt
const FilterListen FilterType = 2 // for Listen
const FilterSocket FilterType = 0 // for Socket