Movatterモバイル変換


[0]ホーム

URL:


nlwrap

package
v2.0.0-beta.5Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License:Apache-2.0Imports:5Imported by:0

Details

Repository

github.com/moby/moby

Links

Documentation

Overview

Package nlwrap wraps vishvandanda/netlink functions that may return EINTR.

A Handle instantiated usingNewHandle orNewHandleAt can be used in placeof a netlink.Handle, it's a wrapper that replaces methods that need to bewrapped. Functions that use the package handle need to be called as "nlwrap.X"instead of "netlink.X".

When netlink.ErrDumpInterrupted is returned, the wrapped functions retry up tomaxAttempts times. This error means NLM_F_DUMP_INTR was flagged in a netlinkresponse, meaning something changed during the dump so results may beincomplete or inconsistent.

To avoid retrying indefinitely, if netlink.ErrDumpInterrupted is stillreturned after maxAttempts, the wrapped functions will discard the error, loga stack trace to make the issue visible and aid in debugging, and return thepossibly inconsistent results. Returning possibly inconsistent results matchesthe behaviour of vishvananda/netlink versions prior to 1.2.1, in which theNLM_F_DUMP_INTR flag was ignored.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcAddrList

func AddrList(linknetlink.Link, familyint) (addrs []netlink.Addr, errerror)

AddrList calls netlink.AddrList, retrying if necessary.

funcConntrackTableList

func ConntrackTableList(tablenetlink.ConntrackTableType,familynetlink.InetFamily,) (flows []*netlink.ConntrackFlow, errerror)

ConntrackTableList calls netlink.ConntrackTableList, retrying if necessary.

funcLinkByName

func LinkByName(namestring) (linknetlink.Link, errerror)

LinkByName calls netlink.LinkByName, retrying if necessary. The netlinkfunction doesn't normally ask the kernel for a dump of links. But, on an oldkernel, it will do as a fallback and that dump may get inconsistent results.

funcLinkList

func LinkList() (links []netlink.Link, errerror)

LinkList calls netlink.Handle.LinkList, retrying if necessary.

funcLinkSubscribeWithOptions

func LinkSubscribeWithOptions(ch chan<-netlink.LinkUpdate, done <-chan struct{}, optionsnetlink.LinkSubscribeOptions) (errerror)

LinkSubscribeWithOptions calls netlink.LinkSubscribeWithOptions, retrying if necessary.Close the done channel when done (rather than just sending on it), so that goroutinesstarted by the netlink package are all stopped.

Types

typeHandle

type Handle struct {*netlink.Handle}

funcNewHandle

func NewHandle(nlFamilies ...int) (Handle,error)

funcNewHandleAt

func NewHandleAt(nsnetns.NsHandle, nlFamilies ...int) (Handle,error)

func (Handle)AddrList

func (nlhHandle) AddrList(linknetlink.Link, familyint) (addrs []netlink.Addr, errerror)

AddrList calls nlh.Handle.AddrList, retrying if necessary.

func (Handle)Close

func (nlhHandle) Close()

func (Handle)ConntrackDeleteFilters

func (nlhHandle) ConntrackDeleteFilters(tablenetlink.ConntrackTableType,familynetlink.InetFamily,filters ...netlink.CustomConntrackFilter,) (matcheduint, errerror)

ConntrackDeleteFilters calls nlh.Handle.ConntrackDeleteFilters, retrying if necessary.

func (Handle)LinkByName

func (nlhHandle) LinkByName(namestring) (linknetlink.Link, errerror)

LinkByName calls nlh.Handle.LinkByName, retrying if necessary. The netlink functiondoesn't normally ask the kernel for a dump of links. But, on an old kernel, itwill do as a fallback and that dump may get inconsistent results.

func (Handle)LinkList

func (nlhHandle) LinkList() (links []netlink.Link, errerror)

LinkList calls nlh.Handle.LinkList, retrying if necessary.

func (Handle)RouteList

func (nlhHandle) RouteList(linknetlink.Link, familyint) (routes []netlink.Route, errerror)

RouteList calls nlh.Handle.RouteList, retrying if necessary.

func (Handle)XfrmPolicyList

func (nlhHandle) XfrmPolicyList(familyint) (policies []netlink.XfrmPolicy, errerror)

XfrmPolicyList calls nlh.Handle.XfrmPolicyList, retrying if necessary.

func (Handle)XfrmStateList

func (nlhHandle) XfrmStateList(familyint) (states []netlink.XfrmState, errerror)

XfrmStateList calls nlh.Handle.XfrmStateList, retrying if necessary.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp