2019-09-05 06:35:13 -07:00
|
|
|
# netlink [![builds.sr.ht status](https://builds.sr.ht/~mdlayher/netlink.svg)](https://builds.sr.ht/~mdlayher/netlink?) [![GoDoc](https://godoc.org/github.com/mdlayher/netlink?status.svg)](https://godoc.org/github.com/mdlayher/netlink) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/netlink)](https://goreportcard.com/report/github.com/mdlayher/netlink)
|
2017-01-09 11:33:55 -08:00
|
|
|
|
|
|
|
Package `netlink` provides low-level access to Linux netlink sockets.
|
|
|
|
MIT Licensed.
|
|
|
|
|
2017-11-02 04:30:34 -07:00
|
|
|
For more information about how netlink works, check out my blog series
|
2019-09-05 06:35:13 -07:00
|
|
|
on [Linux, Netlink, and Go](https://mdlayher.com/blog/linux-netlink-and-go-part-1-netlink/).
|
2017-11-02 04:30:34 -07:00
|
|
|
|
2019-09-05 06:35:13 -07:00
|
|
|
If you have any questions or you'd like some guidance, please join us on
|
|
|
|
[Gophers Slack](https://invite.slack.golangbridge.org) in the `#networking`
|
|
|
|
channel!
|
2017-11-02 04:30:34 -07:00
|
|
|
|
2019-09-05 06:35:13 -07:00
|
|
|
## Stability
|
|
|
|
|
2020-02-18 04:27:11 -08:00
|
|
|
See the [CHANGELOG](./CHANGELOG.md) file for a description of changes between
|
|
|
|
releases.
|
|
|
|
|
|
|
|
This package has a stable v1 API and any future breaking changes will prompt
|
|
|
|
the release of a new major version. Features and bug fixes will continue to
|
|
|
|
occur in the v1.x.x series.
|
2019-09-05 06:35:13 -07:00
|
|
|
|
|
|
|
The general policy of this package is to only support the latest, stable version
|
|
|
|
of Go. Compatibility shims may be added for prior versions of Go on an as-needed
|
|
|
|
basis. If you would like to raise a concern, please [file an issue](https://github.com/mdlayher/netlink/issues/new).
|
|
|
|
|
2020-02-18 04:27:11 -08:00
|
|
|
**If you depend on this package in your applications, please use Go modules.**
|
2019-09-05 06:35:13 -07:00
|
|
|
|
|
|
|
## Design
|
2017-01-09 11:33:55 -08:00
|
|
|
|
|
|
|
A [number of netlink packages](https://godoc.org/?q=netlink) are already
|
|
|
|
available for Go, but I wasn't able to find one that aligned with what
|
|
|
|
I wanted in a netlink package:
|
|
|
|
|
2019-09-05 06:35:13 -07:00
|
|
|
- Straightforward, idiomatic API
|
2017-01-09 11:33:55 -08:00
|
|
|
- Well tested
|
|
|
|
- Well documented
|
2019-09-05 06:35:13 -07:00
|
|
|
- Doesn't use package/global variables or state
|
|
|
|
- Doesn't necessarily need root to work
|
2017-01-09 11:33:55 -08:00
|
|
|
|
|
|
|
My goal for this package is to use it as a building block for the creation
|
2017-11-02 04:30:34 -07:00
|
|
|
of other netlink family packages.
|
2019-09-05 06:35:13 -07:00
|
|
|
|
|
|
|
## Ecosystem
|
|
|
|
|
|
|
|
Over time, an ecosystem of Go packages has developed around package `netlink`.
|
|
|
|
Many of these packages provide building blocks for further interactions with
|
|
|
|
various netlink families, such as `NETLINK_GENERIC` or `NETLINK_ROUTE`.
|
|
|
|
|
|
|
|
To have your package included in this diagram, please send a pull request!
|
|
|
|
|
|
|
|
![netlink ecosystem](./netlink.svg)
|