// UnsetLinkIp configures the link's IP address.
// It is equivalent of running: ip address del ${address}/${mask} dev ${interface name}
342086
func (l *Link) UnsetLinkIp(ip net.IP, network *net.IPNet) error {
	return netlink.NetworkLinkDelIp(l.NetInterface(), ip, network)
}
135132
func (s *DeleteIPSetInput) SetIPSetId(v string) *DeleteIPSetInput {
	s.IPSetId = &v
	return s
}
601339
func (s *ElasticIp) SetIp(v string) *ElasticIp {
	s.Ip = &v
	return s
}
653431
func (s *Http) SetClientIp(v string) *Http {
	s.ClientIp = &v
	return s
}
1175575
func (s *InputDestination) SetIp(v string) *InputDestination {
	s.Ip = &v
	return s
}
738086
func setAddr4(link *netlink.Vxlan, ipn *net.IPNet) error {
	addrs, err := netlink.AddrList(link, syscall.AF_INET)
	if err != nil {
		return err
	}

	addr := netlink.Addr{IPNet: ipn}
	existing := false
	for _, old := range addrs {
		if old.IPNet.String() == addr.IPNet.String() {
			existing = true
			continue
		}
		if err = netlink.AddrDel(link, &old); err != nil {
			return fmt.Errorf("failed to delete IPv4 addr %s from %s", old.String(), link.Attrs().Name)
		}
	}

	if !existing {
		if err = netlink.AddrAdd(link, &addr); err != nil {
			return fmt.Errorf("failed to add IP address %s to %s: %s", ipn.String(), link.Attrs().Name, err)
		}
	}

	return nil
}
261051
func (_m *API) AssignIP(_a0 api.IPConfig) error {
	ret := _m.Called(_a0)

	var r0 error
	if rf, ok := ret.Get(0).(func(api.IPConfig) error); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
711795
func (c *OsdnNodeConfig) setNodeIP() error {
	if len(c.Hostname) == 0 {
		output, err := kexec.New().Command("uname", "-n").CombinedOutput()
		if err != nil {
			return err
		}
		c.Hostname = strings.TrimSpace(string(output))
		klog.Infof("Resolved hostname to %q", c.Hostname)
	}

	if len(c.SelfIP) == 0 {
		var err error
		c.SelfIP, err = netutils.GetNodeIP(c.Hostname)
		if err != nil {
			klog.V(5).Infof("Failed to determine node address from hostname %s; using default interface (%v)", c.Hostname, err)
			var defaultIP net.IP
			defaultIP, err = kubeutilnet.ChooseHostInterface()
			if err != nil {
				return err
			}
			c.SelfIP = defaultIP.String()
			klog.Infof("Resolved IP address to %q", c.SelfIP)
		}
	}

	if _, _, err := GetLinkDetails(c.SelfIP); err != nil {
		if err == ErrorNetworkInterfaceNotFound {
			err = fmt.Errorf("node IP %q is not a local/private address (hostname %q)", c.SelfIP, c.Hostname)
		}
		utilruntime.HandleError(fmt.Errorf("Unable to find network interface for node IP; some features will not work! (%v)", err))
	}

	return nil
}
19695
func (s *NetworkBinding) SetBindIP(v string) *NetworkBinding {
	s.BindIP = &v
	return s
}
439619
func (s *IpAddressResponse) SetIp(v string) *IpAddressResponse {
	s.Ip = &v
	return s
}
215725
func (s *TargetAddress) SetIp(v string) *TargetAddress {
	s.Ip = &v
	return s
}
892917
func (s *LoadBalancerAddress) SetIpAddress(v string) *LoadBalancerAddress {
	s.IpAddress = &v
	return s
}
89308
func (a *API) UnlinkDomain(user *User, domain int) error {
	url := a.BuildURL("/v2/user/%d/domains/%d", user.Id, domain)
	return a.Delete(url, Params{})
}
490954
func (a *HostAgent) BindIP(ipprefix, netmask, iface string) error {
	logger := plog.WithFields(logrus.Fields{
		"ipaddress": ipprefix,
		"netmask":   netmask,
		"interface": iface,
	})

	// calculate the cidr bytes
	cidr, _ := net.IPMask(net.ParseIP(netmask).To4()).Size()
	ip := fmt.Sprintf("%s/%d", ipprefix, cidr)

	if vip := a.vip.Find(ipprefix); vip != nil {
		// return if the ips match
		if !vip.Matches(ip, iface) {
			if err := a.vip.Release(vip.Addr, vip.Device); err != nil {
				logger.WithError(err).Error("Could not release virtual ip for update")
				return err
			}
		} else {
			return nil
		}
	}

	// check the interface
	if _, err := net.InterfaceByName(iface); err != nil {
		logger.WithError(err).Error("Could not look up interface to bind virtual ip")
		return err
	}

	// bind the virtual ip
	if err := a.vip.Bind(ip, iface); err != nil {
		logger.WithError(err).Error("Could not bind virtual ip")
		return err
	}

	return nil
}
291306
func (s *ModifyHsmInput) SetEniIp(v string) *ModifyHsmInput {
	s.EniIp = &v
	return s
}
980600
func (a *api) SetIP(config IPConfig) error {
	client, err := a.connectMaster()
	if err != nil {
		return err
	}

	req := addressassignment.AssignmentRequest{
		ServiceID:      config.ServiceID,
		IPAddress:      config.IPAddress,
		AutoAssignment: config.IPAddress == "",
		Port:		config.Port,
		Proto:		config.Proto,
		EndpointName:	config.EndpointName,
	}

	if err := client.SetIPs(req); err != nil {
		return err
	}

	return nil
}
1270177
func (s *Socket) Unbind(endpoint string) (err error) {
	cstr := C.CString(endpoint)
	defer C.free(unsafe.Pointer(cstr))
	r := C.zmq_unbind(s.sock, cstr)
	if r == -1 {
		err = zmqerr()
	}
	return
}