Documentation ¶
Index ¶
- Constants
- type HostInterface
- func (hi *HostInterface) AddContainerLink(namespace, ifname string, addr *net.IPNet) (int, error)
- func (hi *HostInterface) DeleteContainerLink(namespace, name string) error
- func (hi *HostInterface) DeleteLinks()
- func (hi *HostInterface) GetMVLinkIndex() (int, error)
- func (hi *HostInterface) GetOption(opt string) (string, bool)
- func (hi *HostInterface) GetVXLinkIndex() (int, error)
- func (hi *HostInterface) NumContainers() (int, error)
Constants ¶
const ( //DefaultVxlanRouteTable is the table index to store routes for directly connected networks //this is necessary because the host prefixes are more specific and otherwise cause packets //to be routed for directly connected networks DefaultVxlanRouteTable = 192 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostInterface ¶
type HostInterface struct { VxlanParams *vxlan.Vxlan Gateway *net.IPNet Prefix *net.IPNet // contains filtered or unexported fields }
HostInterface represents the host's connection to the vxlan It must be made up of both a "vxlan" interface which participates in the cluster's vxlan and a "macvlan" slave of the vxlan interface which acts as the hosts connection to that vxlan the hosts address gets isntalled on the macvlan
func Get ¶
Get returns an existing valid host interface if the links exist, or an error if the host interface is not valid or otherwise paritially configured it will delete the remnants to allow a create to be called.
func GetOrCreate ¶
GetOrCreate creates required host interfaces if they don't exist, or gets them if they already do
func (*HostInterface) AddContainerLink ¶
AddContainerLink adds a new macvlan link to the vxlan link, adds an IP, and puts it in the requested namespace.
func (*HostInterface) DeleteContainerLink ¶
func (hi *HostInterface) DeleteContainerLink(namespace, name string) error
DeleteContainerLink deletes the containers interface
func (*HostInterface) DeleteLinks ¶
func (hi *HostInterface) DeleteLinks()
DeleteLinks removes the components of the host interface from the host
func (*HostInterface) GetMVLinkIndex ¶
func (hi *HostInterface) GetMVLinkIndex() (int, error)
GetMVLinkIndex gets the link index for the host's macvlan
func (*HostInterface) GetOption ¶
func (hi *HostInterface) GetOption(opt string) (string, bool)
GetOption gets the names vxlan option from the options map
func (*HostInterface) GetVXLinkIndex ¶
func (hi *HostInterface) GetVXLinkIndex() (int, error)
GetVXLinkIndex gets the link index for the host's vxlan
func (*HostInterface) NumContainers ¶
func (hi *HostInterface) NumContainers() (int, error)
NumContainers returns the number of network namespaces with child interfaces of the host's vxlan