Documentation ¶
Overview ¶
Package kernel - describe kernel mechanism
Index ¶
- Constants
- func New(netnsURL string) *networkservice.Mechanism
- type Mechanism
- func (m *Mechanism) GetDeviceTokenID() string
- func (m *Mechanism) GetInterfaceName() string
- func (m *Mechanism) GetNetNSInode() string
- func (m *Mechanism) GetNetNSURL() string
- func (m *Mechanism) GetPCIAddress() string
- func (m *Mechanism) GetParameters() map[string]string
- func (m *Mechanism) GetVLAN() uint32
- func (m *Mechanism) IsPCIDevice() bool
- func (m *Mechanism) SetDeviceTokenID(tokenID string)
- func (m *Mechanism) SetInterfaceName(interfaceName string)
- func (m *Mechanism) SetNetNSInode(netNSInode string)
- func (m *Mechanism) SetNetNSURL(urlString string)
- func (m *Mechanism) SetPCIAddress(pciAddress string)
- func (m *Mechanism) SetSupportsVLAN(supportsVlan bool)
- func (m *Mechanism) SetVLAN(vlan uint32) *Mechanism
- func (m *Mechanism) SupportsVLAN() bool
Constants ¶
const ( // MECHANISM string MECHANISM = "KERNEL" // LinuxIfMaxLength - Linux has a limit of 15 characters for an interface name LinuxIfMaxLength = 15 // PCIAddressKey - device PCI address property key PCIAddressKey = common.PCIAddressKey // DeviceTokenIDKey is a device token ID property key DeviceTokenIDKey = common.DeviceTokenIDKey // NetNSInodeKey - netns inode mechanism property key NetNSInodeKey = common.NetNSInodeKey // InterfaceNameKey - interface name mechanism property key InterfaceNameKey = common.InterfaceNameKey // NetNSURL - NetNS URL, it can be either: // * file:///proc/${pid}/ns/net - ${pid} process net NS // * inode://${dev}/${ino} - while transferring file between processes using grpcfd NetNSURL = common.InodeURL // NetNSURLScheme - expected scheme of NetNSURLs NetNSURLScheme = "file" // SupportsVLAN - flag set if the forwarder supports VLAN trunking SupportsVLAN = "supportsVlan" // VLAN - VLAN ID VLAN = "vlan" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(netnsURL string) *networkservice.Mechanism
New returns *networkservice.Mechanism of type kernel using the given netnsURL (file:///proc/${pid}/ns/net)
Types ¶
type Mechanism ¶
type Mechanism struct {
*networkservice.Mechanism
}
Mechanism is a kernel mechanism helper
func ToMechanism ¶
func ToMechanism(m *networkservice.Mechanism) *Mechanism
ToMechanism converts unified mechanism to helper If Mechanism m is *not* of type kernel.MECHANISM, it returns nil
func (*Mechanism) GetDeviceTokenID ¶ added in v1.1.0
GetDeviceTokenID returns device token ID
func (*Mechanism) GetInterfaceName ¶
GetInterfaceName returns the Kernel Interface Name
func (*Mechanism) GetNetNSInode ¶
GetNetNSInode returns the NetNS inode
func (*Mechanism) GetNetNSURL ¶
GetNetNSURL returns the NetNS URL, it can be either: * file:///proc/${pid}/ns/net - ${pid} process net NS * inode://${dev}/${ino} - while transferring file between processes using grpcfd
func (*Mechanism) GetPCIAddress ¶
GetPCIAddress returns the PCI address of the device
func (*Mechanism) GetParameters ¶
GetParameters returns the map of all parameters to the mechanism
func (*Mechanism) IsPCIDevice ¶
IsPCIDevice returns if this mechanism is for a PCI device
func (*Mechanism) SetDeviceTokenID ¶ added in v1.1.0
SetDeviceTokenID sets device token ID
func (*Mechanism) SetInterfaceName ¶
SetInterfaceName sets the Kernel Interface Name
func (*Mechanism) SetNetNSInode ¶
SetNetNSInode sets the NetNS inode
func (*Mechanism) SetNetNSURL ¶
SetNetNSURL sets the NetNS URL - file:///proc/${pid}/ns/net
func (*Mechanism) SetPCIAddress ¶
SetPCIAddress sets the PCI address of the device
func (*Mechanism) SetSupportsVLAN ¶ added in v1.1.0
SetSupportsVLAN set SupportsVLAN flag
func (*Mechanism) SupportsVLAN ¶ added in v1.1.0
SupportsVLAN returns SupportsVLAN flag