// SetLinkNsFd sets the link's Linux namespace to the one specified by filesystem path.
437612
func (l *Link) SetLinkNsFd(nspath string) error {
	fd, err := syscall.Open(nspath, syscall.O_RDONLY, 0)
	if err != nil {
		return fmt.Errorf("Could not attach to Network namespace: %s", err)
	}

	return netlink.NetworkSetNsFd(l.NetInterface(), fd)
}
1030630
func (s *ListMetricsInput) SetNamespace(v string) *ListMetricsInput {
	s.Namespace = &v
	return s
}
1253483
func (s *CloudWatchAlarmDefinition) SetNamespace(v string) *CloudWatchAlarmDefinition {
	s.Namespace = &v
	return s
}
1117159
func (s *RegisterUserInput) SetNamespace(v string) *RegisterUserInput {
	s.Namespace = &v
	return s
}
748303
func (s *Disk) SetDiskNode(v string) *Disk {
	s.DiskNode = &v
	return s
}
411319
func (s *Metric) SetNamespace(v string) *Metric {
	s.Namespace = &v
	return s
}
276079
func (l *Link) SetLinkNsToDocker(name string, dockerHost string) error {
	pid, err := DockerPidByName(name, dockerHost)
	if err != nil {
		return fmt.Errorf("Failed to find docker %s :  %s", name, err)
	}

	return l.SetLinkNetNsPid(pid)
}
493985
func (s *UpdateGroupInput) SetNamespace(v string) *UpdateGroupInput {
	s.Namespace = &v
	return s
}
300417
func (c *Client) SetNamespace(namespace string) {
	c.modifyLock.Lock()
	defer c.modifyLock.Unlock()
	c.setNamespace(namespace)
}
205187
func (s *FileSystemDescription) SetFileSystemId(v string) *FileSystemDescription {
	s.FileSystemId = &v
	return s
}
493365
func setIfAttrs(pid int, ifname, cidr, cidr6, newname string) error {
	nsenterPath, err := osexec.LookPath("nsenter")
	if err != nil {
		return err
	}
	ipPath, err := osexec.LookPath("ip")
	if err != nil {
		return err
	}

	// find the link
	link, err := getLink(ifname)
	if err != nil {
		log.Errorf("unable to find link %q. Error %q", ifname, err)
		return err
	}

	// move to the desired netns
	err = netlink.LinkSetNsPid(link, pid)
	if err != nil {
		log.Errorf("unable to move interface %s to pid %d. Error: %s",
			ifname, pid, err)
		return err
	}

	// rename to the desired ifname
	nsPid := fmt.Sprintf("%d", pid)
	rename, err := osexec.Command(nsenterPath, "-t", nsPid, "-n", "-F", "--", ipPath, "link",
		"set", "dev", ifname, "name", newname).CombinedOutput()
	if err != nil {
		log.Errorf("unable to rename interface %s to %s. Error: %s",
			ifname, newname, err)
		return nil
	}
	log.Infof("Output from rename: %v", rename)

	// set the ip address
	assignIP, err := osexec.Command(nsenterPath, "-t", nsPid, "-n", "-F", "--", ipPath,
		"address", "add", cidr, "dev", newname).CombinedOutput()

	if err != nil {
		log.Errorf("unable to assign ip %s to %s. Error: %s",
			cidr, newname, err)
		return nil
	}
	log.Infof("Output from ip assign: %v", assignIP)

	if cidr6 != "" {
		out, err := osexec.Command(nsenterPath, "-t", nsPid, "-n", "-F", "--", ipPath,
			"-6", "address", "add", cidr6, "dev", newname).CombinedOutput()
		if err != nil {
			log.Errorf("unable to assign IPv6 %s to %s. Error: %s",
				cidr6, newname, err)
			return nil
		}
		log.Infof("Output of IPv6 assign: %v", out)
	}

	// Finally, mark the link up
	bringUp, err := osexec.Command(nsenterPath, "-t", nsPid, "-n", "-F", "--", ipPath,
		"link", "set", "dev", newname, "up").CombinedOutput()

	if err != nil {
		log.Errorf("unable to assign ip %s to %s. Error: %s",
			cidr, newname, err)
		return nil
	}
	log.Debugf("Output from ip assign: %v", bringUp)
	return nil

}
679569
func SetNamespace() error {
	initOnce.Do(Init)
	if err := netns.Set(initNs); err != nil {
		linkInfo, linkErr := getLink()
		if linkErr != nil {
			linkInfo = linkErr.Error()
		}
		return fmt.Errorf("failed to set to initial namespace, %v, initns fd %d: %v", linkInfo, initNs, err)
	}
	return nil
}
1135671
func (s *ListUsersInput) SetNamespace(v string) *ListUsersInput {
	s.Namespace = &v
	return s
}
842017
func (c SimpleFSClient) SimpleFSSymlink(ctx context.Context, __arg SimpleFSSymlinkArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.SimpleFS.simpleFSSymlink", []interface{}{__arg}, nil)
	return
}
622165
func (s *ListGroupMembershipsInput) SetNamespace(v string) *ListGroupMembershipsInput {
	s.Namespace = &v
	return s
}
1066295
func (s *MountTargetDescription) SetFileSystemId(v string) *MountTargetDescription {
	s.FileSystemId = &v
	return s
}
976072
func (s *BatchListOutgoingTypedLinks) SetFilterTypedLink(v *TypedLinkSchemaAndFacetName) *BatchListOutgoingTypedLinks {
	s.FilterTypedLink = v
	return s
}