nlwrap
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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¶
- func AddrList(link netlink.Link, family int) (addrs []netlink.Addr, err error)
- func ConntrackTableList(table netlink.ConntrackTableType, family netlink.InetFamily) (flows []*netlink.ConntrackFlow, err error)
- func LinkByName(name string) (link netlink.Link, err error)
- func LinkList() (links []netlink.Link, err error)
- func LinkSubscribeWithOptions(ch chan<- netlink.LinkUpdate, done <-chan struct{}, ...) (err error)
- type Handle
- func (nlh Handle) AddrList(link netlink.Link, family int) (addrs []netlink.Addr, err error)
- func (nlh Handle) Close()
- func (nlh Handle) ConntrackDeleteFilters(table netlink.ConntrackTableType, family netlink.InetFamily, ...) (matched uint, err error)
- func (nlh Handle) LinkByName(name string) (link netlink.Link, err error)
- func (nlh Handle) LinkList() (links []netlink.Link, err error)
- func (nlh Handle) RouteList(link netlink.Link, family int) (routes []netlink.Route, err error)
- func (nlh Handle) XfrmPolicyList(family int) (policies []netlink.XfrmPolicy, err error)
- func (nlh Handle) XfrmStateList(family int) (states []netlink.XfrmState, err error)
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcConntrackTableList¶
func ConntrackTableList(tablenetlink.ConntrackTableType,familynetlink.InetFamily,) (flows []*netlink.ConntrackFlow, errerror)
ConntrackTableList calls netlink.ConntrackTableList, retrying if necessary.
funcLinkByName¶
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.
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¶
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¶
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)XfrmPolicyList¶
func (nlhHandle) XfrmPolicyList(familyint) (policies []netlink.XfrmPolicy, errerror)
XfrmPolicyList calls nlh.Handle.XfrmPolicyList, retrying if necessary.