set ip next-hop 1.1.1.1 2.2.2.2 3.3.3.3 load-share
 set ip next-hop load-share
552095
def set_ipv4_next_hop_load_share
      arr = config_get('route_map', 'set_ipv4_next_hop', @get_args)
      val = default_set_ipv4_next_hop_load_share
      arr.each do |str|
        next if str.empty?
        return true if str.include?('load-share')
      end
      val
    end
987599
function(host, next) {
    var tokens = tldtools.extract(host),
      resolvingHost;

    if (ipaddr.IPv4.isValid(host) || ipaddr.IPv6.isValid(host) ) {
      next(false, [ host ], host);
    } else {
      resolvingHost = tokens.inspect.getDomain() || tokens.domain;
      dns.resolve(resolvingHost, function(err, aRecords) {
        next(err, aRecords, resolvingHost );
      });
    }
  }
507666
function listen(next) {

        listenSocket = dgram.createSocket({ type: 'udp4', reuseAddr: true });

        listenSocket.on('message', function(payload, rinfo) {
            var message = parseMessage(payload, rinfo);
            if (message) {
                if (message.id != id) {
                    if (message.status == "ONE") {
                        updateNodeList(message);
                    } else if (message.name != listenNameIdentifier && message.status == "NAMETAKEN") {
                        stop(function() {
                            //throw new Error('name already taken "' + name + '"');
                            self.emit("error", {cause: "Name already taken"});
                        });
                    }
                } else {
                    //self.emit('error', id + " already exists in network");
                    throw new Error(id + ' already exits in network');
                    stop();
                }
            }
        });

        listenSocket.bind(function(err) {
            var info = listenSocket.address();
            self.port = info.port;
            next(err);
        });

    }
538420
public void setIP(byte[] ip) {
        buffer[INDEX_IP] = ip[0];
        buffer[INDEX_IP + 1] = ip[1];
        buffer[INDEX_IP + 2] = ip[2];
        buffer[INDEX_IP + 3] = ip[3];
    }
267537
def add_ip(self,oid,value,label=None):
		""""""
		self.add_oid_entry(oid,'IPADDRESS',value,label=label)
264497
def set_address(self, host, port):
        """"""
        self.host = host
        self.port = port
549956
public function next()
    {
        if ($this->valid()) {
            $this->current = $this->current->getIntValue() == $this->range->getEnd()->getIntValue()
                ? null
                : new IP($this->current->getIntValue() + 1);
        }
    }
89133
def set_ipv6_next_hop_load_share
      arr = config_get('route_map', 'set_ipv6_next_hop', @get_args)
      val = default_set_ipv6_next_hop_load_share
      arr.each do |str|
        next if str.empty?
        return true if str.include?('load-share')
      end
      val
    end
1343511
def nth_next_sib(nth)
			if (nth < 0)
				return nil
			end
			
			shift = 128 - self.netmask.prefix_len
			addr = ((self.network.addr>>shift) + nth) << shift
			if addr > NetAddr::F128
				return nil
			end
			return IPv6Net.new(IPv6.new(addr), self.netmask)
		end
866495
def update_ip_rule(self, ip, mac):
        """"""

        rule_no = self._find_rule_no(mac)
        chain = self._find_chain_name(mac)
        if not rule_no or not chain:
            LOG.error('Failed to update ip rule for %(ip)s %(mac)s',
                      {'ip': ip, 'mac': mac})
            return

        update_cmd = ['iptables', '-R', '%s' % chain, '%s' % rule_no,
                      '-s', '%s/32' % ip, '-m', 'mac', '--mac-source',
                      '%s' % mac, '-j', 'RETURN']
        LOG.debug('Execute command: %s', update_cmd)
        dsl.execute(update_cmd, self._root_helper, log_output=False)
1058342
public OvhIpTask ip_move_POST(String ip, String nexthop, String to) throws IOException {
		String qPath = "/ip/{ip}/move";
		StringBuilder sb = path(qPath, ip);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "nexthop", nexthop);
		addBody(o, "to", to);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhIpTask.class);
	}
1045384
def nth_next_sib(nth)
			if (nth < 0)
				return nil
			end
			
			shift = 32 - self.netmask.prefix_len
			addr = ((self.network.addr>>shift) + nth) << shift
			if addr > NetAddr::F32
				return nil
			end
			return IPv4Net.new(IPv4.new(addr), self.netmask)
		end
88983
def program_rtr_all_nwk_next_hop(self, tenant_id, rout_id, next_hop,
                                     excl_list):
        
        namespace = self.find_rtr_namespace(rout_id)
        if namespace is None:
            LOG.error("Unable to find namespace for router %s", rout_id)
            return False

        net_list = self.get_network_by_tenant(tenant_id)
        for net in net_list:
            subnet_lst = self.get_subnets_for_net(net.get('id'))
            for subnet_elem in subnet_lst:
                subnet = subnet_elem.get('cidr').split('/')[0]
                subnet_and_mask = subnet_elem.get('cidr')
                if subnet not in excl_list:
                    args = ['route', 'add', '-net', subnet_and_mask, 'gw',
                            next_hop]
                    ret = self.program_rtr(args, rout_id, namespace=namespace)
                    if not ret:
                        LOG.error("Program router returned error for %s",
                                  rout_id)
                        return False
        return True
687682
def pack_ip_addr(addr):
    """"""
    addr, port = addr
    return socket.inet_aton(addr) + struct.pack('!H', port & _short_mask)
1162306
def _set_static_ip(name, session, vm_):
    '''
    
    '''
    ipv4_cidr = ''
    ipv4_gw = ''
    if 'ipv4_gw' in vm_.keys():
        log.debug('ipv4_gw is found in keys')
        ipv4_gw = vm_['ipv4_gw']
    if 'ipv4_cidr' in vm_.keys():
        log.debug('ipv4_cidr is found in keys')
        ipv4_cidr = vm_['ipv4_cidr']
        log.debug('attempting to set IP in instance')
        set_vm_ip(name, ipv4_cidr, ipv4_gw, session, None)
845726
def convert_to_ip(self):
        """"""
        self._values, self._header._unit = self._header.data_type.to_ip(
                self._values, self._header.unit)
576149
def set_current(self, current):
        
        self.current = current
        self.input = current.input
        # self.req = current.request
        # self.resp = current.response
        self.output = current.output
        self.cmd = current.task_data['cmd']

        if self.cmd and NEXT_CMD_SPLITTER in self.cmd:
            self.cmd, self.next_cmd = self.cmd.split(NEXT_CMD_SPLITTER)
        else:
            self.next_cmd = None