File: driver.go

package info (click to toggle)
golang-github-jsimonetti-rtnetlink 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,440 kB
  • sloc: makefile: 2
file content (28 lines) | stat: -rw-r--r-- 726 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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)
	}
}