// setIfAttrs sets the required attributes for the container interface
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

}
968581
func (s *ThingDocument) SetAttributes(v map[string]*string) *ThingDocument {
	s.Attributes = v
	return s
}
525388
func (s *Item) SetAttributes(v []*Attribute) *Item {
	s.Attributes = v
	return s
}
1002709
func (s *UpdateContactAttributesInput) SetAttributes(v map[string]*string) *UpdateContactAttributesInput {
	s.Attributes = v
	return s
}
413801
func (s *attrStore) SetAttrs(id uint64, m map[string]interface{}) error {
	// Ignore empty maps.
	if len(m) == 0 {
		return nil
	}

	// Check if the attributes already exist under a read-only lock.
	if attr, err := s.Attrs(id); err != nil {
		return errors.Wrap(err, "checking attrs")
	} else if attr != nil && mapContains(attr, m) {
		return nil
	}

	// Obtain write lock.
	s.mu.Lock()
	defer s.mu.Unlock()

	var attr map[string]interface{}
	if err := s.db.Update(func(tx *bolt.Tx) error {
		tmp, err := txUpdateAttrs(tx, id, m)
		if err != nil {
			return err
		}
		attr = tmp

		return nil
	}); err != nil {
		return errors.Wrap(err, "updating store")
	}

	// Swap attributes map in cache.
	s.attrCache.Set(id, attr)

	return nil
}
328924
func (s *PlatformApplication) SetAttributes(v map[string]*string) *PlatformApplication {
	s.Attributes = v
	return s
}
558553
func (s *HttpInstanceSummary) SetAttributes(v map[string]*string) *HttpInstanceSummary {
	s.Attributes = v
	return s
}
716786
func (s *AttachTypedLinkInput) SetAttributes(v []*AttributeNameAndValue) *AttachTypedLinkInput {
	s.Attributes = v
	return s
}
686785
func (s *ListTypedLinkFacetAttributesOutput) SetAttributes(v []*TypedLinkAttributeDefinition) *ListTypedLinkFacetAttributesOutput {
	s.Attributes = v
	return s
}
998291
func (s *UpdateStackInput) SetAttributes(v map[string]*string) *UpdateStackInput {
	s.Attributes = v
	return s
}
524659
func (s *AddAttributesToFindingsInput) SetAttributes(v []*Attribute) *AddAttributesToFindingsInput {
	s.Attributes = v
	return s
}
884988
func (s *DeviceDescription) SetAttributes(v map[string]*string) *DeviceDescription {
	s.Attributes = v
	return s
}
1174938
func (s *PublicEndpoint) SetAttributes(v map[string][]*string) *PublicEndpoint {
	s.Attributes = v
	return s
}
766973
func (s *DescribeTargetGroupAttributesOutput) SetAttributes(v []*TargetGroupAttribute) *DescribeTargetGroupAttributesOutput {
	s.Attributes = v
	return s
}
383791
func (s *CloneStackInput) SetAttributes(v map[string]*string) *CloneStackInput {
	s.Attributes = v
	return s
}
539868
func (s *GetTopicAttributesOutput) SetAttributes(v map[string]*string) *GetTopicAttributesOutput {
	s.Attributes = v
	return s
}
206905
func (c *TableCell) SetAttributes(attr tcell.AttrMask) *TableCell {
	c.Attributes = attr
	return c
}