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.
* 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
- Variables
- func AddHostRoute(containerIP *net.IPNet, host netlink.Link, src net.IP) error
- func AddToBridge(ifaceName, bridgeName string) error
- func ChildLinkSize(masterIndex int) (int, error)
- func ContainerVethName(containerId string, suffix string) string
- func CreateBridgeDevice(bridgeName string, hwAddr net.HardwareAddr) error
- func CreateVeth(containerID string, mtu int, suffix string) (netlink.Link, netlink.Link, error)
- func DeleteAllVeth(netnsPath string) error
- func DeleteHostVeth(containerId, suffix string) error
- func DeleteVeth(netnsPath, ifName string) error
- func DisableRpFilter(dev string) error
- func EnableNonlocalBind() error
- func GenerateIfaceName(prefix string, len int) (string, error)
- func GenerateMACFromIP(ip net.IP) net.HardwareAddr
- func GenerateRandomMAC() net.HardwareAddr
- func GenerateRandomName(prefix string, size int) (string, error)
- func GetDefaultRoute() (*netlink.Route, error)
- func GetDefaultRouteGw() (net.IP, error)
- func HostIPVlanName(containerId string) string
- func HostMacVlanName(containerId string) string
- func HostVethName(containerId string, suffix string) string
- func IPVlanConnectsHostWithContainer(result *t020.Result, args *skel.CmdArgs, parent int, mode netlink.IPVlanMode, ...) error
- func MacVlanConnectsHostWithContainer(result *t020.Result, args *skel.CmdArgs, parent int, mtu int) error
- func SendGratuitousARP(dev, ip, nns string, useArpRequest bool) error
- func SetProxyArp(dev string) error
- func UnSetArpIgnore(dev string) error
- func VethConnectsHostWithContainer(result *t020.Result, args *skel.CmdArgs, bridgeName string, suffix string, ...) error
Constants ¶
const ( UnderlayVethDeviceSuffix = "u" VlanDeviceSuffix = "l" )
Variables ¶
var (
ErrNoDefaultRoute = errors.New("no default route was found")
)
Functions ¶
func AddToBridge ¶
func ChildLinkSize ¶
func ContainerVethName ¶
func CreateBridgeDevice ¶
func CreateBridgeDevice(bridgeName string, hwAddr net.HardwareAddr) error
CreateBridgeDevice create a new bridge interface/
func CreateVeth ¶
func DeleteAllVeth ¶
DeleteAllVeth deletes all veth device inside the container
func DeleteHostVeth ¶
DeleteHostVeth deletes veth device in the host network namespace
func DeleteVeth ¶
DeleteVeth deletes veth device inside the container
func DisableRpFilter ¶
func EnableNonlocalBind ¶
func EnableNonlocalBind() error
func GenerateIfaceName ¶
GenerateIfaceName returns an interface name using the passed in prefix and the length of random bytes. The api ensures that the there are is no interface which exists with that name.
func GenerateMACFromIP ¶
func GenerateMACFromIP(ip net.IP) net.HardwareAddr
GenerateMACFromIP returns a locally administered MAC address where the 4 least significant bytes are derived from the IPv4 address.
func GenerateRandomMAC ¶
func GenerateRandomMAC() net.HardwareAddr
GenerateRandomMAC returns a new 6-byte(48-bit) hardware address (MAC)
func GenerateRandomName ¶
GenerateRandomName returns a new name joined with a prefix. This size specified is used to truncate the randomly generated value
func GetDefaultRoute ¶
GetDefaultRoute returns the default route.
func GetDefaultRouteGw ¶
GetDefaultRouteGw returns the GW for the default route's interface.
func HostIPVlanName ¶
func HostMacVlanName ¶
func HostVethName ¶
func IPVlanConnectsHostWithContainer ¶
func IPVlanConnectsHostWithContainer(result *t020.Result, args *skel.CmdArgs, parent int, mode netlink.IPVlanMode, mtu int) error
IPVlanConnectsHostWithContainer creates ipvlan device onto parent device and connects container with host
func MacVlanConnectsHostWithContainer ¶
func MacVlanConnectsHostWithContainer(result *t020.Result, args *skel.CmdArgs, parent int, mtu int) error
MacVlanConnectsHostWithContainer creates macvlan device onto parent and connects container with host
func SendGratuitousARP ¶
func SetProxyArp ¶
func UnSetArpIgnore ¶
func VethConnectsHostWithContainer ¶
func VethConnectsHostWithContainer(result *t020.Result, args *skel.CmdArgs, bridgeName string, suffix string, src net.IP) error
#lizard forgives VethConnectsHostWithContainer creates veth device pairs and connects container with host If bridgeName specified, it attaches host side veth device to the bridge
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
* Tencent is pleased to support the open source community by making TKEStack available.
|
* Tencent is pleased to support the open source community by making TKEStack available. |
* Tencent is pleased to support the open source community by making TKEStack available.
|
* Tencent is pleased to support the open source community by making TKEStack available. |
* Tencent is pleased to support the open source community by making TKEStack available.
|
* Tencent is pleased to support the open source community by making TKEStack available. |
* Tencent is pleased to support the open source community by making TKEStack available.
|
* Tencent is pleased to support the open source community by making TKEStack available. |
* Tencent is pleased to support the open source community by making TKEStack available.
|
* Tencent is pleased to support the open source community by making TKEStack available. |
* Tencent is pleased to support the open source community by making TKEStack available.
|
* Tencent is pleased to support the open source community by making TKEStack available. |