Categorygithub.com/WebP2P/netlink
modulepackage
1.2.2
Repository: https://github.com/webp2p/netlink.git
Documentation: pkg.go.dev

# README

netlink - netlink library for go

The netlink package provides a simple netlink library for go. Netlink is the interface a user-space program in linux uses to communicate with the kernel. It can be used to add and remove interfaces, set ip addresses and routes, and configure ipsec. Netlink communication requires elevated privileges, so in most cases this code needs to be run as root. Since low-level netlink messages are inscrutable at best, the library attempts to provide an api that is loosely modeled on the CLI provided by iproute2. Actions like ip link add will be accomplished via a similarly named function like AddLink(). This library began its life as a fork of the netlink functionality in docker/libcontainer but was heavily rewritten to improve testability, performance, and to add new functionality like ipsec xfrm handling.

Local Build and Test

You can use go get command:

go get github.com/WebP2P/netlink

Testing dependencies:

go get github.com/vishvananda/netns

Testing (requires root):

sudo -E go test github.com/WebP2P/netlink

Examples

Add a new bridge and add eth1 into it:

package main

import (
    "fmt"
    "github.com/WebP2P/netlink"
)

func main() {
    la := netlink.NewLinkAttrs()
    la.Name = "foo"
    mybridge := &netlink.Bridge{LinkAttrs: la}
    err := netlink.LinkAdd(mybridge)
    if err != nil  {
        fmt.Printf("could not add %s: %v\n", la.Name, err)
    }
    eth1, _ := netlink.LinkByName("eth1")
    netlink.LinkSetMaster(eth1, mybridge)
}

Note NewLinkAttrs constructor, it sets default values in structure. For now it sets only TxQLen to -1, so kernel will set default by itself. If you're using simple initialization(LinkAttrs{Name: "foo"}) TxQLen will be set to 0 unless you specify it like LinkAttrs{Name: "foo", TxQLen: 1000}.

Add a new ip address to loopback:

package main

import (
    "github.com/WebP2P/netlink"
)

func main() {
    lo, _ := netlink.LinkByName("lo")
    addr, _ := netlink.ParseAddr("169.254.169.254/32")
    netlink.AddrAdd(lo, addr)
}

Future Work

Many pieces of netlink are not yet fully supported in the high-level interface. Aspects of virtually all of the high-level objects don't exist. Many of the underlying primitives are there, so its a matter of putting the right fields into the high-level objects and making sure that they are serialized and deserialized correctly in the Add and List methods.

There are also a few pieces of low level netlink functionality that still need to be implemented. Routing rules are not in place and some of the more advanced link types. Hopefully there is decent structure and testing in place to make these fairly straightforward to add.

# Packages

Package nl has low level primitives for making Netlink calls.

# Functions

AddrAdd will add an IP address to a link device.
AddrAdd will add an IP address to a link device.
AddrDel will delete an IP address from a link device.
AddrDel will delete an IP address from a link device.
AddrList gets a list of IP addresses in the system.
AddrList gets a list of IP addresses in the system.
AddrReplace will replace (or, if not present, add) an IP address on a link device.
AddrReplace will replace (or, if not present, add) an IP address on a link device.
AddrSubscribe takes a chan down which notifications will be sent when addresses change.
AddrSubscribe takes a chan down which notifications will be sent when addresses change.
AddrSubscribeAt works like AddrSubscribe plus it allows the caller to choose the network namespace in which to subscribe (ns).
AddrSubscribeAt works like AddrSubscribe plus it allows the caller to choose the network namespace in which to subscribe (ns).
AddrSubscribeWithOptions work like AddrSubscribe but enable to provide additional options to modify the behavior.
AddrSubscribeWithOptions work like AddrSubscribe but enable to provide additional options to modify the behavior.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BridgeVlanAdd adds a new vlan filter entry Equivalent to: `bridge vlan add dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]`.
BridgeVlanDel adds a new vlan filter entry Equivalent to: `bridge vlan del dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]`.
BridgeVlanList gets a map of device id to bridge vlan infos.
No description provided by the author
ClassAdd will add a class to the system.
ClassChange will change a class in place Equivalent to: `tc class change $class` The parent and handle MUST NOT be changed.
ClassDel will delete a class from the system.
ClassList gets a list of classes in the system.
ClassReplace will replace a class to the system.
No description provided by the author
ConntrackDeleteFilter deletes entries on the specified table on the base of the filter conntrack -D [table] parameters Delete conntrack or expectation.
ConntrackTableFlush flushes all the flows of a specified table conntrack -F [table] Flush table The flush operation applies to all the family types.
ConntrackTableList returns the flow list of a table of a specific family conntrack -L [table] [options] List conntrack or expectation table.
No description provided by the author
DevlinkGetDeviceByName provides a pointer to devlink device and nil error, otherwise returns an error code.
DevLinkGetDeviceList provides a pointer to devlink devices and nil error, otherwise returns an error code.
DevLinkSetEswitchMode sets eswitch mode if able to set successfully or returns an error code.
No description provided by the author
FilterAdd will add a filter to the system.
FilterDel will delete a filter from the system.
FilterList gets a list of filters in the system.
FilterReplace will replace a filter.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetNetNsIdByFd looks up the network namespace ID for a given fd.
GetNetNsIdByPid looks up the network namespace ID for a given pid (really thread id).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LinkAdd adds a new link device.
LinkByAlias finds a link by its alias and returns a pointer to the object.
LinkByIndex finds a link by index and returns a pointer to the object.
LinkByName finds a link by name and returns a pointer to the object.
LinkDel deletes link device.
linkDeserialize deserializes a raw message received from netlink into a link object.
No description provided by the author
LinkList gets a list of link devices.
LinkSetAlias sets the alias of the link device.
LinkSetAllmulticastOff disables the reception of all hardware multicast packets for the link device.
LinkSetAllmulticastOn enables the reception of all hardware multicast packets for the link device.
No description provided by the author
No description provided by the author
LinkSetBondSlave add slave to bond link via ioctl interface.
LinkSetBondSlaveQueueId modify bond slave queue-id.
No description provided by the author
No description provided by the author
LinkSetDown disables link device.
No description provided by the author
No description provided by the author
LinkSetGroup sets the link group id which can be used to perform mass actions with iproute2 as well use it as a reference in nft filters.
No description provided by the author
No description provided by the author
LinkSetHardwareAddr sets the hardware address of the link device.
No description provided by the author
LinkSetMaster sets the master of the link device.
LinkSetMasterByIndex sets the master of the link device.
LinkSetMTU sets the mtu of the link device.
LinkSetName sets the name of the link device.
LinkSetNoMaster removes the master of the link device.
LinkSetNsFd puts the device into a new network namespace.
LinkSetNsPid puts the device into a new network namespace.
No description provided by the author
LinkSetTxQLen sets the transaction queue length for the link.
LinkSetUp enables the link device.
LinkSetVfHardwareAddr sets the hardware address of a vf for the link.
LinkSetVfNodeGUID sets the node GUID of a vf for the link.
LinkSetVfPortGUID sets the port GUID of a vf for the link.
LinkSetVfRate sets the min and max tx rate of a vf for the link.
LinkSetVfSpoofchk enables/disables spoof check on a vf for the link.
LinkSetVfState enables/disables virtual link state on a vf.
LinkSetVfTrust enables/disables trust state on a vf for the link.
LinkSetVfTxRate sets the tx rate of a vf for the link.
LinkSetVfVlan sets the vlan of a vf for the link.
LinkSetVfVlanQos sets the vlan and qos priority of a vf for the link.
LinkSetXdpFd adds a bpf function to the driver.
LinkSetXdpFdWithFlags adds a bpf function to the driver with the given options.
LinkSubscribe takes a chan down which notifications will be sent when links change.
LinkSubscribeAt works like LinkSubscribe plus it allows the caller to choose the network namespace in which to subscribe (ns).
LinkSubscribeWithOptions work like LinkSubscribe but enable to provide additional options to modify the behavior.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NeighAdd will add an IP to MAC mapping to the ARP table Equivalent to: `ip neigh add ....`.
NeighAppend will append an entry to FDB Equivalent to: `bridge fdb append...`.
NeighDel will delete an IP address from a link device.
No description provided by the author
NeighList returns a list of IP-MAC mappings in the system (ARP table).
NeighListExecute returns a list of neighbour entries filtered by link, ip family, flag and state.
NeighProxyList returns a list of neighbor proxies in the system.
NeighSet will add or replace an IP to MAC mapping to the ARP table Equivalent to: `ip neigh replace....`.
NeighSubscribe takes a chan down which notifications will be sent when neighbors are added or deleted.
NeighSubscribeAt works like NeighSubscribe plus it allows the caller to choose the network namespace in which to subscribe (ns).
NeighSubscribeWithOptions work like NeighSubscribe but enable to provide additional options to modify the behavior.
NewClassStatistics Construct a ClassStatistics struct which fields are all initialized by 0.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewHandle returns a netlink handle on the current network namespace.
NewHandleAt returns a netlink handle on the network namespace specified by ns.
NewHandleAtFrom works as NewHandle but allows client to specify the new and the origin netns Handle.
No description provided by the author
NewHfscClass returns a new HFSC struct with the set parameters.
No description provided by the author
NewHtbClass NOTE: function is in here because it uses other linux functions.
NewIPNet generates an IPNet from an ip address using a netmask of 32 or 128.
NewLinkAttrs returns LinkAttrs structure filled with default values.
No description provided by the author
No description provided by the author
NOTE function is here because it uses other linux functions.
No description provided by the author
NewRule return empty rules.
NewRulePortRange creates rule sport/dport range.
No description provided by the author
No description provided by the author
ParseAddr parses the string representation of an address in the form $ip/$netmask $label.
ParseIPNet parses a string in ip/net format and returns a net.IPNet.
No description provided by the author
QdiscAdd will add a qdisc to the system.
QdiscChange will change a qdisc in place Equivalent to: `tc qdisc change $qdisc` The parent and handle MUST NOT be changed.
QdiscDel will delete a qdisc from the system.
QdiscList gets a list of qdiscs in the system.
QdiscReplace will replace a qdisc to the system.
RdmaLinkByName finds a link by name and returns a pointer to the object if found and nil error, otherwise returns error code.
RdmaLinkList gets a list of RDMA link devices.
RdmaLinkSetName sets the name of the rdma link device.
RdmaLinkSetNsFd puts the RDMA device into a new network namespace.
RdmaSystemGetNetnsMode gets the net namespace mode for RDMA subsystem Returns mode string and error status as nil on success or returns error otherwise.
RdmaSystemSetNetnsMode sets the net namespace mode for RDMA subsystem Returns nil on success or appropriate error code.
RouteAdd will add a route to the system.
RouteDel will delete a route from the system.
RouteGet gets a route to a specific destination from the host system.
RouteGetWithOptions gets a route to a specific destination from the host system.
RouteList gets a list of routes in the system.
RouteListFiltered gets a list of routes in the system filtered with specified rules.
RouteReplace will add a route to the system.
RouteSubscribe takes a chan down which notifications will be sent when routes are added or deleted.
RouteSubscribeAt works like RouteSubscribe plus it allows the caller to choose the network namespace in which to subscribe (ns).
RouteSubscribeWithOptions work like RouteSubscribe but enable to provide additional options to modify the behavior.
RuleAdd adds a rule to the system.
RuleDel deletes a rule from the system.
RuleList lists rules in the system.
RuleListFiltered gets a list of rules in the system filtered by the specified rule template `filter`.
No description provided by the author
SetNetNSIdByFd sets the ID of the network namespace for a given fd.
SetNetNSIdByPid sets the ID of the network namespace for a given pid (really thread id).
No description provided by the author
No description provided by the author
SocketGet returns the Socket identified by its local and remote addresses.
StringToBondLacpRate returns bond lacp arte, or unknown is the s is invalid.
StringToBondMode returns bond mode, or unknown is the s is invalid.
StringToBondXmitHashPolicy returns bond lacp arte, or unknown is the s is invalid.
StringToVlanProtocol returns vlan protocol, or unknown is the s is invalid.
No description provided by the author
VethPeerIndex get veth peer index.
No description provided by the author
XfrmPolicyAdd will add an xfrm policy to the system.
XfrmPolicyDel will delete an xfrm policy from the system.
XfrmPolicyFlush will flush the policies on the system.
XfrmPolicyGet gets a the policy described by the index or selector, if found.
XfrmPolicyList gets a list of xfrm policies in the system.
XfrmPolicyUpdate will update an xfrm policy to the system.
XfrmStateAdd will add an xfrm state to the system.
XfrmStateAllocSpi will allocate an xfrm state in the system.
XfrmStateDel will delete an xfrm state from the system.
XfrmStateFlush will flush the xfrm state on the system.
XfrmStateGet gets the xfrm state described by the ID, if found.
XfrmStateList gets a list of xfrm states in the system.
XfrmStateUpdate will update an xfrm state to the system.
No description provided by the author

# Constants

Flag mask for bond options.
Possible BondAdSelect value.
Possible BondAdSelect value.
Flag mask for bond options.
Possible BondAdSelect value.
Flag mask for bond options.
Possible BondArpAllTargets value.
Possible BondArpAllTargets value.
Flag mask for bond options.
Flag mask for bond options.
Possible BondArpValidate value.
Possible BondArpValidate value.
Possible BondArpValidate value.
Flag mask for bond options.
Possible BondArpValidate value.
Flag mask for bond options.
Possible BondFailOverMac value.
Possible BondFailOverMac value.
Flag mask for bond options.
Possible BondFailOverMac value.
Possible BondLacpRate value.
Flag mask for bond options.
Possible BondLacpRate value.
Possible BondLacpRate value.
Flag mask for bond options.
Flag mask for bond options.
Flag mask for bond options.
Possible BondMode.
Possible BondMode.
Possible BondMode.
Possible BondMode.
Possible BondMode.
Possible BondMode.
Possible BondMode.
Flag mask for bond options.
Possible BondMode.
Flag mask for bond options.
Flag mask for bond options.
Flag mask for bond options.
Possible BondPrimaryReselect value.
Possible BondPrimaryReselect value.
Possible BondPrimaryReselect value.
Flag mask for bond options.
Flag mask for bond options.
Flag mask for bond options.
Flag mask for bond options.
Possible BondXmitHashPolicy value.
Possible BondXmitHashPolicy value.
Possible BondXmitHashPolicy value.
Possible BondXmitHashPolicy value.
Possible BondXmitHashPolicy value.
Flag mask for bond options.
Possible BondXmitHashPolicy value.
link is going back.
link has been down for too long time.
link has just gone down.
link is up and running.
Link is active.
Link is backup.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ConntrackExpectTable Conntrack expect table https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink.h -> #define NFNL_SUBSYS_CTNETLINK_EXP 2.
deprecated use instead ConntrackReplyAnyIP.
deprecated use instead ConntrackReplyDstIP.
deprecated use instead ConntrackReplySrcIP.
-orig-dst ip Destination address from original direction.
--orig-port-dst port Destination port in original direction.
-orig-src ip Source address from original direction.
--orig-port-src port Source port in original direction.
Match source or destination reply IP.
--reply-dst ip Reply Destination IP.
--reply-src ip Reply Source IP.
ConntrackTable Conntrack table https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink.h -> #define NFNL_SUBSYS_CTNETLINK 1.
ETH_SS_FEATURES are device feature names.
ETH_SS_PRIV_FLAGS are driver private flag names.
ETH_SS_RSS_HASH_FUNCS is RSS hush function names.
ETH_SS_STATS statistic names, for use with %ETHTOOL_GSTATS.
ETH_SS_TEST is self-test result names, for use with %ETHTOOL_TEST.
ETHTOOL_GSSET_INFO gets string set info.
ETHTOOL_GSTATS gets NIC-specific statistics.
ETHTOOL_GSTRINGS gets specified string set.
Family type definitions.
Family type definitions.
Family type definitions.
Family type definitions.
Family type definitions.
Family type definitions.
Family type definitions.
Family type definitions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ideally golang.org/x/sys/unix would define IfReq but it only has IFNAMSIZ, hence this minimalistic implementation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
These can be replaced by the values from sys/unix when it is next released.
These can be replaced by the values from sys/unix when it is next released.
These can be replaced by the values from sys/unix when it is next released.
Neighbor Flags.
Neighbor Flags.
Neighbor Flags.
Neighbor Flags.
Neighbor Flags.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Neighbor Cache Entry States.
Not up but pending an external event.
Down.
Down due to state of lower layer.
Some component is missing.
In some test mode.
Status can't be determined.
Up, ready to send packets.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SIOCETHTOOL is Ethtool interface.
ideally golang.org/x/sys/unix would define IfReq but it only has IFNAMSIZ, hence this minimalistic implementation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Constants used in TcU32Sel.Flags.
Constants used in TcU32Sel.Flags.
Constants used in TcU32Sel.Flags.
Constants used in TcU32Sel.Flags.
mirror packet to EGRESS */.
packet redirect to EGRESS*/.
mirror packet to INGRESS */.
packet redirect to INGRESS*/.
set tunnel key.
unset tunnel key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VlanProtocol possible values.
VlanProtocol possible values.
VlanProtocol possible values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NOTE not defined on darwin.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

ErrAttrBodyTruncated is returned when a netlink attribute's body is truncated.
ErrAttrHeaderTruncated is returned when a netlink attribute's header is truncated.
ErrNotImplemented is returned when a requested feature is not implemented.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Addr represents an IP address from netlink.
AddrSubscribeOptions contains a set of options to use with AddrSubscribeWithOptions.
AddrSubscribeOptions contains a set of options to use with AddrSubscribeWithOptions.
No description provided by the author
No description provided by the author
Bond representation.
BondAdInfo represents ad info for bond.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Bridge links are simple linux bridges.
ClassAttrs represents a netlink class.
ClassStatistics representation based on generic networking statistics for netlink.
No description provided by the author
No description provided by the author
No description provided by the author
Device links cannot be created via netlink.
DevlinkDevAttrs represents device attributes.
DevlinkDevEswitchAttr represents device's eswitch attributes.
DevlinkDevice represents device and its attributes.
Dummy links are dummy ethernet devices.
FilterAttrs represents a netlink filter.
No description provided by the author
No description provided by the author
Fq is a classless packet scheduler meant to be mostly used for locally generated traffic.
FQ_Codel (Fair Queuing Controlled Delay) is queuing discipline that combines Fair Queuing with the CoDel AQM scheme.
Fw filter filters on firewall marks NOTE: this is in filter_linux because it refers to nl.TcPolice which is defined in nl/tc_linux.go.
No description provided by the author
GenericClass classes represent types that are not currently understood by this netlink library.
GenericFilter filters represent types that are not currently understood by this netlink library.
GenericLink links represent types that are not currently understood by this netlink library.
GenericQdisc qdiscs represent types that are not currently understood by this netlink library.
No description provided by the author
No description provided by the author
No description provided by the author
GnetStatsBasic Ref: struct gnet_stats_basic { ..
GnetStatsQueue Ref: struct gnet_stats_queue { ..
GnetStatsRateEst Ref: struct gnet_stats_rate_est { ..
GnetStatsRateEst64 Ref: struct gnet_stats_rate_est64 { ..
Gretap devices must specify LocalIP and RemoteIP on create.
No description provided by the author
No description provided by the author
Handle is an handle for the netlink requests on a specific network namespace.
No description provided by the author
HfscClass is a representation of the HFSC class.
Htb is a classful qdisc that rate limits based on tokens.
HtbClass represents an Htb class.
HtbClassAttrs stores the attributes of HTB class.
Ifb links are advanced dummy devices for packet filtering.
Ifreq is a struct for ioctl ethernet manipulation syscalls.
IfreqSlave is a struct for ioctl bond manipulation syscalls.
Ingress is a qdisc for adding ingress filters.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LinkAttrs represents data shared by most link types.
LinkNotFoundError wraps the various not found errors when getting/reading links.
Ref: struct rtnl_link_stats {...} */.
Ref: struct rtnl_link_stats64 {...} */.
LinkSubscribeOptions contains a set of options to use with LinkSubscribeWithOptions.
LinkUpdate is used to pass information back from LinkSubscribe().
No description provided by the author
Macvlan links have ParentIndex set in their Attrs().
Macvtap - macvtap is a virtual interfaces based on macvlan.
MatchAll filters match all packets.
No description provided by the author
No description provided by the author
No description provided by the author
Ndmsg is for adding, removing or receiving information about a neighbor table entry.
Neigh represents a link layer neighbor from netlink.
NeighSubscribeOptions contains a set of options to use with NeighSubscribeWithOptions.
NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PfifoFast is the default qdisc created by the kernel if one has not been defined for the interface.
Prio is a basic qdisc that works just like PfifoFast.
Protinfo represents bridge flags from netlink.
QdiscAttrs represents a netlink qdisc.
Link represents a rdma device from netlink.
LinkAttrs represents data shared by most link types.
Route represents a netlink route.
RouteGetOptions contains a set of options to use with RouteGetWithOptions.
RouteSubscribeOptions contains a set of options to use with RouteSubscribeWithOptions.
RouteUpdate is sent when a route changes - type is RTM_NEWROUTE or RTM_DELROUTE.
Rule represents a netlink rule.
RulePortRange represents rule sport/dport range.
SEG6 definitions.
SEG6LocalEncap definitions.
ServiceCurve is a nondecreasing function of some time unit, returning the amount of service (an allowed or allocated amount of bandwidth) at some specific point in time.
No description provided by the author
No description provided by the author
Socket represents a netlink socket.
SocketID identifies a single socket.
Tbf is a classless qdisc that rate limits based on tokens.
No description provided by the author
Tuntap links created via /dev/tun/tap, but can be destroyed via netlink.
U32 filters on many packet related properties.
Veth devices must specify PeerName on create.
VfInfo represents configuration of virtual function.
Vlan links have ParentIndex set in their Attrs().
No description provided by the author
No description provided by the author
No description provided by the author
Wireguard represent links of type "wireguard", see https://www.wireguard.com/.
Virtual XFRM Interfaces Named "xfrmi" to prevent confusion with XFRM objects.
XfrmMark represents the mark associated to the state or policy.
No description provided by the author
XfrmPolicy represents an ipsec policy.
XfrmPolicyTmpl encapsulates a rule for the base addresses of an ipsec policy.
XfrmState represents the state of an ipsec policy.
XfrmStateAlgo represents the algorithm to use for the ipsec encryption.
XfrmStateEncap represents the encapsulation to use for the ipsec encryption.
XfrmStateLimits represents the configured limits for the state.
XfrmStateStats represents the current number of bytes/packets processed by this State, the State's installation and first use time and the replay window counters.

# Interfaces

Action represents an action in any supported filter.
Class interfaces for all classes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Link represents a link device from netlink.
LinkSlave represents a slave device.
No description provided by the author
No description provided by the author

# Type aliases

BondAdSelect type.
BondArpAllTargets type.
BondArpValidate type.
BondFailOverMac type.
BondLacpRate type.
BondMode type.
BondPrimaryReselect type.
BondSlaveState represents the values of the IFLA_BOND_SLAVE_MII_STATUS bond slave attribute, which contains the status of MII link monitoring.
BondSlaveState represents the values of the IFLA_BOND_SLAVE_STATE bond slave attribute, which contains the state of the bond slave.
BondXmitHashPolicy type.
No description provided by the author
Filter types.
ConntrackTableType Conntrack table for the netlink operation.
Dir is an enum representing an ipsec template direction.
EncapType is an enum representing the optional packet encapsulation.
InetFamily Family type.
No description provided by the author
No description provided by the author
No description provided by the author
LinkOperState represents the values of the IFLA_OPERSTATE link attribute, which contains the RFC2863 state of the interface.
No description provided by the author
No description provided by the author
No description provided by the author
Mode is an enum representing an ipsec transport.
No description provided by the author
No description provided by the author
No description provided by the author
PolicyAction is an enum representing an ipsec policy action.
Proto is an enum representing an ipsec protocol.
Scope is an enum representing a route scope.
No description provided by the author
No description provided by the author
TcU32Key contained of Sel in the U32 filters.
Sel of the U32 filters that contains multiple TcU32Key.
No description provided by the author
No description provided by the author
No description provided by the author
VlanProtocol type.