mirror of
https://github.com/jsimonetti/rtnetlink.git
synced 2026-03-30 17:32:04 +02:00
Add drivers for bridge, macvlan, vlan, vxlan and add helpers to LinkService to use them (SetMaster, RemoveMaster) Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
29 lines
726 B
Go
29 lines
726 B
Go
// Package driver provides link type specific decoding and encoding types
|
|
// for use with the rtnetlink library.
|
|
package driver
|
|
|
|
import (
|
|
"github.com/jsimonetti/rtnetlink/v2"
|
|
)
|
|
|
|
// init registers predefined drivers with the rtnetlink package.
|
|
//
|
|
// Currently, registering driver implementations that conflict with existing ones isn't supported.
|
|
// Since most users don't need this feature, we'll keep it as is.
|
|
// If required, we could consider implementing rtnetlink.UnregisterDriver to address this.
|
|
func init() {
|
|
for _, drv := range []rtnetlink.LinkDriver{
|
|
&Bond{},
|
|
&BondSlave{},
|
|
&Bridge{},
|
|
&BridgePort{},
|
|
&Macvlan{},
|
|
&Netkit{},
|
|
&Veth{},
|
|
&Vlan{},
|
|
&Vxlan{},
|
|
} {
|
|
_ = rtnetlink.RegisterDriver(drv)
|
|
}
|
|
}
|