var pkgHandle … type Handle … // SetSocketTimeout configures timeout for default netlink sockets func SetSocketTimeout(to time.Duration) error { … } // GetSocketTimeout returns the timeout value used by default netlink sockets func GetSocketTimeout() time.Duration { … } // SupportsNetlinkFamily reports whether the passed netlink family is supported by this Handle func (h *Handle) SupportsNetlinkFamily(nlFamily int) bool { … } // NewHandle returns a netlink handle on the current network namespace. // Caller may specify the netlink families the handle should support. // If no families are specified, all the families the netlink package // supports will be automatically added. func NewHandle(nlFamilies ...int) (*Handle, error) { … } // SetSocketTimeout sets the send and receive timeout for each socket in the // netlink handle. Although the socket timeout has granularity of one // microsecond, the effective granularity is floored by the kernel timer tick, // which default value is four milliseconds. func (h *Handle) SetSocketTimeout(to time.Duration) error { … } // SetSocketReceiveBufferSize sets the receive buffer size for each // socket in the netlink handle. The maximum value is capped by // /proc/sys/net/core/rmem_max. func (h *Handle) SetSocketReceiveBufferSize(size int, force bool) error { … } // GetSocketReceiveBufferSize gets the receiver buffer size for each // socket in the netlink handle. The retrieved value should be the // double to the one set for SetSocketReceiveBufferSize. func (h *Handle) GetSocketReceiveBufferSize() ([]int, error) { … } // SetStrictCheck sets the strict check socket option for each socket in the netlink handle. Returns early if any set operation fails func (h *Handle) SetStrictCheck(state bool) error { … } // NewHandleAt returns a netlink handle on the network namespace // specified by ns. If ns=netns.None(), current network namespace // will be assumed func NewHandleAt(ns netns.NsHandle, nlFamilies ...int) (*Handle, error) { … } // NewHandleAtFrom works as NewHandle but allows client to specify the // new and the origin netns Handle. func NewHandleAtFrom(newNs, curNs netns.NsHandle) (*Handle, error) { … } func newHandle(newNs, curNs netns.NsHandle, nlFamilies ...int) (*Handle, error) { … } // Close releases the resources allocated to this handle func (h *Handle) Close() { … } // Delete releases the resources allocated to this handle // // Deprecated: use Close instead which is in line with typical resource release // patterns for files and other resources. func (h *Handle) Delete() { … } func (h *Handle) newNetlinkRequest(proto, flags int) *nl.NetlinkRequest { … }