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 Socket ¶ added in v1.18.0
Socket is an alias of the netlink library Socket type but it implements deserialization functions.
func (*Socket) Deserialize ¶ added in v1.18.0
Deserialize accepts raw byte data of a netlink socket diag response and deserializes it into the target socket.
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
type SocketRequest ¶ added in v1.18.0
type SocketRequest struct {
Family uint8
Protocol uint8
Ext uint8
States uint32
ID netlink.SocketID
// contains filtered or unexported fields
}
SocketRequest implements netlink.NetlinkRequestData to be used to send socket requests to netlink.
func (*SocketRequest) Len ¶ added in v1.18.0
func (r *SocketRequest) Len() int
func (SocketRequest) Serialize ¶ added in v1.18.0
func (r SocketRequest) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.