示例#1
0
func (m mock) fakeAddVeth(s string) (string, error) {
	_, name := network.VethPairNames(s)
	if _, ok := m[name]; ok {
		return "", fmt.Errorf("veth exists: %s", name)
	}
	m[name] = struct{}{}
	return "tmpVeth", nil
}
示例#2
0
func (m mock) fakeDelVeth(s string) error {
	_, name := network.VethPairNames(s)
	if _, ok := m[name]; !ok {
		return fmt.Errorf("no such veth: %s", name)
	}
	delete(m, name)
	return nil
}
示例#3
0
文件: plugin.go 项目: NetSys/quilt
func endpointExists(eid string) (bool, error) {
	_, name := network.VethPairNames(eid)
	return network.LinkExists("", name)
}