Documentation ¶
Overview ¶
* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * https://opensource.org/licenses/Apache-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func SetupVlanInPureMode(ethDevice string, vlanId uint16) (netlink.Link, error)
- type NetConf
- type VlanDriver
- func (d *VlanDriver) BridgeNameForVlan(vlanId uint16) string
- func (d *VlanDriver) CreateBridgeAndVlanDevice(vlanId uint16) (string, error)
- func (d *VlanDriver) GetIPVlanMode() netlink.IPVlanMode
- func (d *VlanDriver) IPVlanMode() bool
- func (d *VlanDriver) Init() error
- func (d *VlanDriver) LoadConf(bytes []byte) (*NetConf, error)
- func (d *VlanDriver) MacVlanMode() bool
- func (d *VlanDriver) MaybeCreateVlanDevice(vlanId uint16) error
- func (d *VlanDriver) PureMode() bool
Constants ¶
const ( VlanPrefix = "vlan" BridgePrefix = "docker" DefaultBridge = "docker" DefaultIPVlanMode = "l3" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NetConf ¶
type NetConf struct { types.NetConf // The device which has IDC ip address, eg. eth1 or eth1.12 (A vlan device) Device string `json:"device"` // The candidate devices if device is empty Devices []string `json:"devices"` // Supports macvlan, bridge or pure(which avoid create unnecessary bridge), default bridge Switch string `json:"switch"` // Supports ipvlan mode l2, l3, l3s, default is l3 IpVlanMode string `json:"ipvlan_mode"` // Disable creating default bridge DisableDefaultBridge *bool `json:"disable_default_bridge"` DefaultBridgeName string `json:"default_bridge_name"` BridgeNamePrefix string `json:"bridge_name_prefix"` VlanNamePrefix string `json:"vlan_name_prefix"` GratuitousArpRequest bool `json:"gratuitous_arp_request"` MTU int `json:"mtu"` }
type VlanDriver ¶
type VlanDriver struct { //FIXME add a file lock cause we are running multiple processes? *NetConf // The device id of NetConf.Device or created vlan device DeviceIndex int // contains filtered or unexported fields }
func (*VlanDriver) BridgeNameForVlan ¶
func (d *VlanDriver) BridgeNameForVlan(vlanId uint16) string
func (*VlanDriver) CreateBridgeAndVlanDevice ¶
func (d *VlanDriver) CreateBridgeAndVlanDevice(vlanId uint16) (string, error)
#lizard forgives
func (*VlanDriver) GetIPVlanMode ¶
func (d *VlanDriver) GetIPVlanMode() netlink.IPVlanMode
func (*VlanDriver) IPVlanMode ¶
func (d *VlanDriver) IPVlanMode() bool
func (*VlanDriver) MacVlanMode ¶
func (d *VlanDriver) MacVlanMode() bool
func (*VlanDriver) MaybeCreateVlanDevice ¶
func (d *VlanDriver) MaybeCreateVlanDevice(vlanId uint16) error
func (*VlanDriver) PureMode ¶
func (d *VlanDriver) PureMode() bool