interfaces

package
v2.0.0-alpha+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// InterfaceKeyPrefix is a prefix used in ETCD to store configuration for Linux interfaces.
	InterfaceKeyPrefix = "linux/config/v2/interface/"

	// 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/"

	// InterfaceAddressKeyPrefix is used as a common prefix for keys derived from
	// interfaces to represent assigned IP addresses.
	InterfaceAddressKeyPrefix = "linux/interface/address/"
)

Variables

View Source
var LinuxInterface_Type_name = map[int32]string{
	0: "UNDEFINED",
	1: "VETH",
	2: "TAP_TO_VPP",
}
View Source
var LinuxInterface_Type_value = map[string]int32{
	"UNDEFINED":  0,
	"VETH":       1,
	"TAP_TO_VPP": 2,
}

Functions

func InterfaceAddressKey

func InterfaceAddressKey(ifName string, address string) string

InterfaceAddressKey returns key representing IP address assigned to Linux interface.

func InterfaceHostNameKey

func InterfaceHostNameKey(hostName string) string

InterfaceHostNameKey returns key representing Linux interface host name.

func InterfaceKey

func InterfaceKey(ifaceLabel string) string

InterfaceKey returns the key used in ETCD to store configuration of a particular Linux interface.

func InterfaceStateKey

func InterfaceStateKey(ifName string, ifIsUp bool) string

InterfaceStateKey returns key representing admin state of a Linux interface.

func ParseInterfaceAddressKey

func ParseInterfaceAddressKey(key string) (ifName string, ifAddr *net.IPNet, err error)

ParseInterfaceAddressKey parses interface address from key derived from interface by InterfaceAddressKey().

func ParseInterfaceStateKey

func ParseInterfaceStateKey(key string) (ifName string, ifIsUp bool, err error)

ParseInterfaceStateKey parses interface name and state from key derived from interface by InterfaceStateKey().

Types

type LinuxInterface

type LinuxInterface struct {
	Name        string                       `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Type        LinuxInterface_Type          `protobuf:"varint,2,opt,name=type,proto3,enum=interfaces.LinuxInterface_Type" json:"type,omitempty"`
	Namespace   *namespace.LinuxNetNamespace `protobuf:"bytes,3,opt,name=namespace" json:"namespace,omitempty"`
	HostIfName  string                       `protobuf:"bytes,4,opt,name=host_if_name,json=hostIfName,proto3" json:"host_if_name,omitempty"`
	Enabled     bool                         `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
	IpAddresses []string                     `protobuf:"bytes,6,rep,name=ip_addresses,json=ipAddresses" json:"ip_addresses,omitempty"`
	PhysAddress string                       `protobuf:"bytes,7,opt,name=phys_address,json=physAddress,proto3" json:"phys_address,omitempty"`
	Mtu         uint32                       `protobuf:"varint,8,opt,name=mtu,proto3" json:"mtu,omitempty"`
	// Types that are valid to be assigned to Link:
	//	*LinuxInterface_Veth
	//	*LinuxInterface_Tap
	Link                 isLinuxInterface_Link `protobuf_oneof:"link"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

func (*LinuxInterface) Descriptor

func (*LinuxInterface) Descriptor() ([]byte, []int)

func (*LinuxInterface) GetEnabled

func (m *LinuxInterface) GetEnabled() bool

func (*LinuxInterface) GetHostIfName

func (m *LinuxInterface) GetHostIfName() string

func (*LinuxInterface) GetIpAddresses

func (m *LinuxInterface) GetIpAddresses() []string
func (m *LinuxInterface) GetLink() isLinuxInterface_Link

func (*LinuxInterface) GetMtu

func (m *LinuxInterface) GetMtu() uint32

func (*LinuxInterface) GetName

func (m *LinuxInterface) GetName() string

func (*LinuxInterface) GetNamespace

func (m *LinuxInterface) GetNamespace() *namespace.LinuxNetNamespace

func (*LinuxInterface) GetPhysAddress

func (m *LinuxInterface) GetPhysAddress() string

func (*LinuxInterface) GetTap

func (*LinuxInterface) GetType

func (m *LinuxInterface) GetType() LinuxInterface_Type

func (*LinuxInterface) GetVeth

func (*LinuxInterface) ProtoMessage

func (*LinuxInterface) ProtoMessage()

func (*LinuxInterface) Reset

func (m *LinuxInterface) Reset()

func (*LinuxInterface) String

func (m *LinuxInterface) String() string

func (*LinuxInterface) XXX_DiscardUnknown

func (m *LinuxInterface) XXX_DiscardUnknown()

func (*LinuxInterface) XXX_Marshal

func (m *LinuxInterface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LinuxInterface) XXX_Merge

func (dst *LinuxInterface) XXX_Merge(src proto.Message)

func (*LinuxInterface) XXX_OneofFuncs

func (*LinuxInterface) 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 (*LinuxInterface) XXX_Size

func (m *LinuxInterface) XXX_Size() int

func (*LinuxInterface) XXX_Unmarshal

func (m *LinuxInterface) XXX_Unmarshal(b []byte) error

type LinuxInterface_Tap

type LinuxInterface_Tap struct {
	Tap *LinuxInterface_TapLink `protobuf:"bytes,10,opt,name=tap,oneof"`
}
type LinuxInterface_TapLink struct {
	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 (*LinuxInterface_TapLink) Descriptor

func (*LinuxInterface_TapLink) Descriptor() ([]byte, []int)

func (*LinuxInterface_TapLink) GetVppTapIfName

func (m *LinuxInterface_TapLink) GetVppTapIfName() string

func (*LinuxInterface_TapLink) ProtoMessage

func (*LinuxInterface_TapLink) ProtoMessage()

func (*LinuxInterface_TapLink) Reset

func (m *LinuxInterface_TapLink) Reset()

func (*LinuxInterface_TapLink) String

func (m *LinuxInterface_TapLink) String() string

func (*LinuxInterface_TapLink) XXX_DiscardUnknown

func (m *LinuxInterface_TapLink) XXX_DiscardUnknown()

func (*LinuxInterface_TapLink) XXX_Marshal

func (m *LinuxInterface_TapLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LinuxInterface_TapLink) XXX_Merge

func (dst *LinuxInterface_TapLink) XXX_Merge(src proto.Message)

func (*LinuxInterface_TapLink) XXX_Size

func (m *LinuxInterface_TapLink) XXX_Size() int

func (*LinuxInterface_TapLink) XXX_Unmarshal

func (m *LinuxInterface_TapLink) XXX_Unmarshal(b []byte) error

type LinuxInterface_Type

type LinuxInterface_Type int32
const (
	LinuxInterface_UNDEFINED  LinuxInterface_Type = 0
	LinuxInterface_VETH       LinuxInterface_Type = 1
	LinuxInterface_TAP_TO_VPP LinuxInterface_Type = 2
)

func (LinuxInterface_Type) EnumDescriptor

func (LinuxInterface_Type) EnumDescriptor() ([]byte, []int)

func (LinuxInterface_Type) String

func (x LinuxInterface_Type) String() string

type LinuxInterface_Veth

type LinuxInterface_Veth struct {
	Veth *LinuxInterface_VethLink `protobuf:"bytes,9,opt,name=veth,oneof"`
}
type LinuxInterface_VethLink struct {
	PeerIfName           string   `protobuf:"bytes,1,opt,name=peer_if_name,json=peerIfName,proto3" json:"peer_if_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LinuxInterface_VethLink) Descriptor

func (*LinuxInterface_VethLink) Descriptor() ([]byte, []int)

func (*LinuxInterface_VethLink) GetPeerIfName

func (m *LinuxInterface_VethLink) GetPeerIfName() string

func (*LinuxInterface_VethLink) ProtoMessage

func (*LinuxInterface_VethLink) ProtoMessage()

func (*LinuxInterface_VethLink) Reset

func (m *LinuxInterface_VethLink) Reset()

func (*LinuxInterface_VethLink) String

func (m *LinuxInterface_VethLink) String() string

func (*LinuxInterface_VethLink) XXX_DiscardUnknown

func (m *LinuxInterface_VethLink) XXX_DiscardUnknown()

func (*LinuxInterface_VethLink) XXX_Marshal

func (m *LinuxInterface_VethLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LinuxInterface_VethLink) XXX_Merge

func (dst *LinuxInterface_VethLink) XXX_Merge(src proto.Message)

func (*LinuxInterface_VethLink) XXX_Size

func (m *LinuxInterface_VethLink) XXX_Size() int

func (*LinuxInterface_VethLink) XXX_Unmarshal

func (m *LinuxInterface_VethLink) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL