Documentation
¶
Index ¶
Constants ¶
View Source
const ( // KernelIfNameLabel contains the interface name // assigned by the kernel. KernelIfNameLabel = "kernelIfName" // IfNameLabel contains the name of the device // as assigned by the device managers. // must be unique across all devices on the node. IfNameLabel = "ifName" // HWAddrLabel contains the MAC address of the device. HWAddrLabel = "macAddress" // DeviceManagerLabel identifies which Device Manager // published the device. DeviceManagerLabel = "deviceManager" // PoolNameLabel is the pool name. PoolNameLabel = "pool" )
The labels below are used by the device managers to tag their devices for advertising ResourceSlices. These attributes may be used to filter and match devices on a resource claim.
View Source
const (
// MaxInterfaceNameLength is the maximum length for a Linux interface name (IFNAMSIZ - 1)
MaxInterfaceNameLength = 15
)
Interface name validation constants
Variables ¶
This section is empty.
Functions ¶
func ValidateInterfaceName ¶
ValidateInterfaceName validates an interface name according to Linux rules
Types ¶
type Device ¶
type Device interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
GetAttrs() map[resourceapi.QualifiedName]resourceapi.DeviceAttribute
Setup(cfg DeviceConfig) error
Free(cfg DeviceConfig) error
Match(filter v2alpha1.CiliumNetworkDriverDeviceFilter) bool
IfName() string
KernelIfName() string
}
type DeviceConfig ¶
type DeviceConfig struct {
PodIfName string `json:"podIfName,omitempty"` // Custom interface name for the pod namespace
}
func (*DeviceConfig) Empty ¶
func (d *DeviceConfig) Empty() bool
type DeviceManager ¶
type DeviceManagerConfig ¶
type DeviceManagerConfig interface {
IsEnabled() bool
}
type DeviceManagerType ¶
type DeviceManagerType int
const ( // DeviceManagerTypeMock is a sentinel used by unit tests. // It is intentionally kept in the types package so that test files in // the networkdriver package can reference it without importing a real // device-manager package. DeviceManagerTypeMock DeviceManagerType = iota DeviceManagerTypeDummy DeviceManagerTypeUnknown )
func (DeviceManagerType) MarshalText ¶
func (d DeviceManagerType) MarshalText() (text []byte, err error)
func (DeviceManagerType) String ¶
func (d DeviceManagerType) String() string
func (*DeviceManagerType) UnmarshalText ¶
func (d *DeviceManagerType) UnmarshalText(text []byte) error
type SerializedDevice ¶
type SerializedDevice struct {
Manager DeviceManagerType
Dev json.RawMessage
Config DeviceConfig
}
Click to show internal directories.
Click to hide internal directories.