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 }
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 }
func endpointExists(eid string) (bool, error) { _, name := network.VethPairNames(eid) return network.LinkExists("", name) }