sockets

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SOCK_DESTROY = 21
)

Variables

This section is empty.

Functions

func Destroy

func Destroy(filter SocketFilter) error

Destroy destroys sockets matching the passed filter parameters using the sock_diag netlink framework.

Supported families in the filter: syscall.AF_INET, syscall.AF_INET6 Supported protocols in the filter: unix.IPPROTO_UDP

Types

type DestroySocketCB

type DestroySocketCB func(id netlink.SocketID) bool

type SocketDestroyer

type SocketDestroyer interface {
	Destroy(filter SocketFilter) error
}

type SocketFilter

type SocketFilter struct {
	DestIp   net.IP
	DestPort uint16
	Family   uint8
	Protocol uint8
	// Optional callback function to determine whether a filtered socket needs to be destroyed
	DestroyCB DestroySocketCB
}

func (*SocketFilter) MatchSocket

func (f *SocketFilter) MatchSocket(socket netlink.SocketID) bool

Jump to

Keyboard shortcuts

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