Documentation ¶
Index ¶
- Constants
- Variables
- func InterfaceAddressKey(iface string, address string, source netalloc.IPAddressSource) string
- func InterfaceAddressPrefix(iface string) string
- func InterfaceHostNameKey(hostName string) string
- func InterfaceKey(name string) string
- func InterfaceStateKey(ifName string, ifIsUp bool) string
- func ParseInterfaceAddressKey(key string) (iface, address string, source netalloc.IPAddressSource, ...)
- func ParseInterfaceStateKey(key string) (ifName string, ifIsUp bool, isStateKey bool)
- type Interface
- func (*Interface) Descriptor() ([]byte, []int)
- func (m *Interface) GetEnabled() bool
- func (m *Interface) GetHostIfName() string
- func (m *Interface) GetIpAddresses() []string
- func (m *Interface) GetLink() isInterface_Link
- func (m *Interface) GetLinkOnly() bool
- func (m *Interface) GetMtu() uint32
- func (m *Interface) GetName() string
- func (m *Interface) GetNamespace() *namespace.NetNamespace
- func (m *Interface) GetPhysAddress() string
- func (m *Interface) GetTap() *TapLink
- func (m *Interface) GetType() Interface_Type
- func (m *Interface) GetVeth() *VethLink
- func (m *Interface) MarshalJSON() ([]byte, error)
- func (*Interface) ProtoMessage()
- func (m *Interface) Reset()
- func (m *Interface) String() string
- func (m *Interface) UnmarshalJSON(data []byte) error
- func (m *Interface) XXX_DiscardUnknown()
- func (m *Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Interface) XXX_Merge(src proto.Message)
- func (*Interface) XXX_MessageName() string
- func (*Interface) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *Interface) XXX_Size() int
- func (m *Interface) XXX_Unmarshal(b []byte) error
- type Interface_Tap
- type Interface_Type
- type Interface_Veth
- type TapLink
- func (*TapLink) Descriptor() ([]byte, []int)
- func (m *TapLink) GetVppTapIfName() string
- func (*TapLink) ProtoMessage()
- func (m *TapLink) Reset()
- func (m *TapLink) String() string
- func (m *TapLink) XXX_DiscardUnknown()
- func (m *TapLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TapLink) XXX_Merge(src proto.Message)
- func (*TapLink) XXX_MessageName() string
- func (m *TapLink) XXX_Size() int
- func (m *TapLink) XXX_Unmarshal(b []byte) error
- type VethLink
- func (*VethLink) Descriptor() ([]byte, []int)
- func (m *VethLink) GetPeerIfName() string
- func (m *VethLink) GetRxChecksumOffloading() VethLink_ChecksumOffloading
- func (m *VethLink) GetTxChecksumOffloading() VethLink_ChecksumOffloading
- func (*VethLink) ProtoMessage()
- func (m *VethLink) Reset()
- func (m *VethLink) String() string
- func (m *VethLink) XXX_DiscardUnknown()
- func (m *VethLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VethLink) XXX_Merge(src proto.Message)
- func (*VethLink) XXX_MessageName() string
- func (m *VethLink) XXX_Size() int
- func (m *VethLink) XXX_Unmarshal(b []byte) error
- type VethLink_ChecksumOffloading
Constants ¶
const ( // InterfaceHostNameKeyPrefix is the common prefix of all keys representing // existing Linux interfaces in the default namespace (referenced by host names). InterfaceHostNameKeyPrefix = "linux/interface/host-name/" // InterfaceStateKeyPrefix is used as a common prefix for keys derived from // interfaces to represent the interface admin state (up/down). InterfaceStateKeyPrefix = "linux/interface/state/" )
const (
// InvalidKeyPart is used in key for parts which are invalid
InvalidKeyPart = "<invalid>"
)
const ModuleName = "linux.interfaces"
ModuleName is the module name used for models.
Variables ¶
var Interface_Type_name = map[int32]string{
0: "UNDEFINED",
1: "VETH",
2: "TAP_TO_VPP",
3: "LOOPBACK",
4: "EXISTING",
}
var Interface_Type_value = map[string]int32{
"UNDEFINED": 0,
"VETH": 1,
"TAP_TO_VPP": 2,
"LOOPBACK": 3,
"EXISTING": 4,
}
var ( ModelInterface = models.Register(&Interface{}, models.Spec{ Module: ModuleName, Version: "v2", Type: "interface", }) )
var VethLink_ChecksumOffloading_name = map[int32]string{
0: "CHKSM_OFFLOAD_DEFAULT",
1: "CHKSM_OFFLOAD_ENABLED",
2: "CHKSM_OFFLOAD_DISABLED",
}
var VethLink_ChecksumOffloading_value = map[string]int32{
"CHKSM_OFFLOAD_DEFAULT": 0,
"CHKSM_OFFLOAD_ENABLED": 1,
"CHKSM_OFFLOAD_DISABLED": 2,
}
Functions ¶
func InterfaceAddressKey ¶
func InterfaceAddressKey(iface string, address string, source netalloc.IPAddressSource) string
InterfaceAddressKey returns key representing IP address assigned to Linux interface.
func InterfaceAddressPrefix ¶
InterfaceAddressPrefix returns longest-common prefix of keys representing assigned IP addresses to a specific Linux interface.
func InterfaceHostNameKey ¶
InterfaceHostNameKey returns key representing Linux interface host name.
func InterfaceKey ¶
InterfaceKey returns the key used in ETCD to store configuration of a particular Linux interface.
func InterfaceStateKey ¶
InterfaceStateKey returns key representing admin state of a Linux interface.
func ParseInterfaceAddressKey ¶
func ParseInterfaceAddressKey(key string) (iface, address string, source netalloc.IPAddressSource, invalidKey, isAddrKey bool)
ParseInterfaceAddressKey parses interface address from key derived from interface by InterfaceAddressKey().
Types ¶
type Interface ¶
type Interface struct { // Name is mandatory field representing logical name for the interface. // It must be unique across all configured interfaces. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Type represents the type of interface and It must match with actual Link. Type Interface_Type `protobuf:"varint,2,opt,name=type,proto3,enum=linux.interfaces.Interface_Type" json:"type,omitempty"` // Namespace is a reference to a Linux network namespace where the interface // should be put into. Namespace *namespace.NetNamespace `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // Name of the interface in the host OS. If not set, the host name will be // the same as the interface logical name. HostIfName string `protobuf:"bytes,4,opt,name=host_if_name,json=hostIfName,proto3" json:"host_if_name,omitempty"` // Enabled controls if the interface should be UP. Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` // IPAddresses define list of IP addresses for the interface and must be // defined in the following format: <ipAddress>/<ipPrefix>. // Interface IP address can be also allocated via netalloc plugin and // referenced here, see: api/models/netalloc/netalloc.proto IpAddresses []string `protobuf:"bytes,6,rep,name=ip_addresses,json=ipAddresses,proto3" json:"ip_addresses,omitempty"` // PhysAddress represents physical address (MAC) of the interface. // Random address will be assigned if left empty. PhysAddress string `protobuf:"bytes,7,opt,name=phys_address,json=physAddress,proto3" json:"phys_address,omitempty"` // MTU is the maximum transmission unit value. Mtu uint32 `protobuf:"varint,8,opt,name=mtu,proto3" json:"mtu,omitempty"` // Types that are valid to be assigned to Link: // *Interface_Veth // *Interface_Tap Link isInterface_Link `protobuf_oneof:"link"` // Configure/Resync link only. IP/MAC addresses are expected to be configured // externally - i.e. by a different agent or manually via CLI. LinkOnly bool `protobuf:"varint,9,opt,name=link_only,json=linkOnly,proto3" json:"link_only,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Interface) Descriptor ¶
func (*Interface) GetEnabled ¶
func (*Interface) GetHostIfName ¶
func (*Interface) GetIpAddresses ¶
func (*Interface) GetLinkOnly ¶
func (*Interface) GetNamespace ¶
func (m *Interface) GetNamespace() *namespace.NetNamespace
func (*Interface) GetPhysAddress ¶
func (*Interface) GetType ¶
func (m *Interface) GetType() Interface_Type
func (*Interface) MarshalJSON ¶
MarshalJSON ensures that field of type 'oneOf' is correctly marshaled by using gogo lib marshaller
func (*Interface) ProtoMessage ¶
func (*Interface) ProtoMessage()
func (*Interface) UnmarshalJSON ¶
UnmarshalJSON ensures that field of type 'oneOf' is correctly unmarshaled
func (*Interface) XXX_DiscardUnknown ¶
func (m *Interface) XXX_DiscardUnknown()
func (*Interface) XXX_Marshal ¶
func (*Interface) XXX_MessageName ¶
func (*Interface) XXX_OneofFuncs ¶
func (*Interface) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*Interface) XXX_Unmarshal ¶
type Interface_Tap ¶
type Interface_Tap struct {
Tap *TapLink `protobuf:"bytes,21,opt,name=tap,proto3,oneof"`
}
type Interface_Type ¶
type Interface_Type int32
const ( Interface_UNDEFINED Interface_Type = 0 Interface_VETH Interface_Type = 1 Interface_TAP_TO_VPP Interface_Type = 2 Interface_LOOPBACK Interface_Type = 3 Interface_EXISTING Interface_Type = 4 )
func (Interface_Type) EnumDescriptor ¶
func (Interface_Type) EnumDescriptor() ([]byte, []int)
func (Interface_Type) String ¶
func (x Interface_Type) String() string
type Interface_Veth ¶
type Interface_Veth struct {
Veth *VethLink `protobuf:"bytes,20,opt,name=veth,proto3,oneof"`
}
type TapLink ¶
type TapLink struct { // Logical name of the VPP TAP interface (mandatory for TAP_TO_VPP) VppTapIfName string `protobuf:"bytes,1,opt,name=vpp_tap_if_name,json=vppTapIfName,proto3" json:"vpp_tap_if_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TapLink) Descriptor ¶
func (*TapLink) GetVppTapIfName ¶
func (*TapLink) ProtoMessage ¶
func (*TapLink) ProtoMessage()
func (*TapLink) XXX_DiscardUnknown ¶
func (m *TapLink) XXX_DiscardUnknown()
func (*TapLink) XXX_Marshal ¶
func (*TapLink) XXX_MessageName ¶
func (*TapLink) XXX_Unmarshal ¶
type VethLink ¶
type VethLink struct { // Name of the VETH peer, i.e. other end of the linux veth (mandatory for VETH) PeerIfName string `protobuf:"bytes,1,opt,name=peer_if_name,json=peerIfName,proto3" json:"peer_if_name,omitempty"` // Checksum offloading - Rx side (enabled by default) RxChecksumOffloading VethLink_ChecksumOffloading `` /* 174-byte string literal not displayed */ // Checksum offloading - Tx side (enabled by default) TxChecksumOffloading VethLink_ChecksumOffloading `` /* 174-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*VethLink) Descriptor ¶
func (*VethLink) GetPeerIfName ¶
func (*VethLink) GetRxChecksumOffloading ¶
func (m *VethLink) GetRxChecksumOffloading() VethLink_ChecksumOffloading
func (*VethLink) GetTxChecksumOffloading ¶
func (m *VethLink) GetTxChecksumOffloading() VethLink_ChecksumOffloading
func (*VethLink) ProtoMessage ¶
func (*VethLink) ProtoMessage()
func (*VethLink) XXX_DiscardUnknown ¶
func (m *VethLink) XXX_DiscardUnknown()
func (*VethLink) XXX_Marshal ¶
func (*VethLink) XXX_MessageName ¶
func (*VethLink) XXX_Unmarshal ¶
type VethLink_ChecksumOffloading ¶
type VethLink_ChecksumOffloading int32
const ( VethLink_CHKSM_OFFLOAD_DEFAULT VethLink_ChecksumOffloading = 0 VethLink_CHKSM_OFFLOAD_ENABLED VethLink_ChecksumOffloading = 1 VethLink_CHKSM_OFFLOAD_DISABLED VethLink_ChecksumOffloading = 2 )
func (VethLink_ChecksumOffloading) EnumDescriptor ¶
func (VethLink_ChecksumOffloading) EnumDescriptor() ([]byte, []int)
func (VethLink_ChecksumOffloading) String ¶
func (x VethLink_ChecksumOffloading) String() string