Lines Matching defs:to

4  * The contents of this file are subject to the terms of the
22 * Use is subject to license terms.
75 * This macro is used to compare 16bit, wrapping sequence numbers. Inspired by
80 #define MAX_WAIT 10 /* max sec. to wait for response */
122 static struct sockaddr_in to; /* where to send */
128 struct targetaddr *current_targetaddr; /* current target IP address to probe */
129 static struct targetaddr *targetaddr_list; /* list of IP addresses to probe */
130 static int num_targetaddrs; /* no of target addresses to probe */
138 /* that goes to target and comes back */
139 /* to the the sender via src routing. */
159 int npackets; /* number of packets to send */
161 static int hoplimit = -1; /* time-to-live value */
169 * This buffer stores the received packets. Currently it needs to be 32 bit
175 /* Used to store the ancillary data that comes with the received packets */
178 static int ntransmitted; /* number of packet sent to single IP address */
182 * These are used for statistics. tmin is initialized to maximum longint value.
238 union any_in_addr *src_addr_list = NULL; /* src addrs to use */
242 ushort_t udp_src_port6; /* used to identify replies */
260 * we need to check for it in our limit set before trying
261 * to set it.
493 * send_reply, which sends the probe packet back to itself
527 bzero((char *)&to, sizeof (struct sockaddr_in));
528 to.sin_family = AF_INET;
600 * have to bump up this number by at least one.
606 /* Round up to 4 byte boundary */
639 * If sending back to ourself, add the mirror image of current
640 * gateways, so that the probes travel to and from the target
695 /* SIGALRM is used to send the next scheduled probe */
700 * From now on, we'll always be listening to ICMP packets. As SIGALRM
712 * name lookup results returned from name server to determine which addresses
713 * to probe, how many times, in which order.
764 * to be linked with others, forming a global targetaddr list. Each targetaddr
765 * item contains information about probes sent to a specific IP address.
784 * npackets determines how many probes to send to each target
785 * IP address. npackets == 0 means send only 1 and move on to
816 * addresses to use for each target address.
890 * Gateway addresses are added to the appropriate passed-in array; the
1023 /* convert it back to a string */
1030 * is large enough to contain the associated v4
1031 * address and so we don't need to use a strn/lcpy
1040 * that address. Therefore, it's a failure case to ask
1041 * get_hostinfo() to treat a broadcast or a mapped address
1063 * For each IP address of the target host, determine a source address to use.
1098 * we send to.
1137 * For a given destination address, determine a source address to use.
1183 * If there's no route to the destination, this connect() call
1185 * address, so that user can get to see "no route to dest"
1186 * message, as it'll try to send the probe packet out and will
1234 "to specify IPv4 nexthop router.\n",
1242 /* revert to non-privileged user */
1291 /* revert to non-privileged user after opening sockets */
1310 "to bypass IPsec policy.\n", progname);
1347 "privilege to bypass IPsec "
1361 * In order to distinguish replies to our UDP probes from
1362 * other pings', we need to know our source port number.
1374 /* Let's bind() send_sock to wildcard address and port */
1433 char_op = 0; /* used to turn off option */
1443 int_op = 0; /* used to turn off option */
1459 /* Applies to unicast and multicast. */
1485 * Applies to unicast, broadcast and multicast.
1568 /* We enable or disable to not depend on the kernel default */
1680 * send_scheduled_probe() to send next probe.
1691 * the latter is not linear and is prone to resetting or drifting
1736 * We are about to move to next targetaddr if it's either we sent
1737 * all the probes, or somebody set the probing_done flag to
1738 * _B_TRUE prompting us to move on.
1761 * If this is probe-all without stats mode, then we need to
1762 * preserve this count. This is needed when we try to map an
1763 * icmp_seq to IP address. Otherwise, clear it.
1785 * Each time we move to a new targetaddr, which has
1795 /* sending back to ourself */
1820 to.sin_addr = current_targetaddr->dst_addr.addr;
1822 * Set IPv4 options when sending the first probe to a target
1846 &current_targetaddr->src_addr.addr, &to.sin_addr);
1848 pinger(send_sock, (struct sockaddr *)&to, NULL, AF_INET);
1855 * recv_icmp_packet()'s job is to listen to icmp packets and filter out
1931 * received a reply for each probe sent to this address,
1944 * function determines if this IP address is one of the host's addresses to
1945 * which we're sending probes. Used to determine if we are interested in a
1981 * of the data portion are used to hold a UNIX "timeval" struct in network
1982 * byte-order, to compute the round-trip time.
1995 struct sockaddr_in *to = (struct sockaddr_in *)whereto;
2016 to->sin_port = htons(dest_port);
2050 /* if packet is big enough to store timeval OR ... */
2154 /* append numeric address to hostname string */
2210 * truncate it down to MAX_ICMP_SEQ/2. We are not going to accept any
2228 * to.
2242 * If this is probe_all and not stats, then the number of probes sent to
2243 * each IP address may be different (remember, we stop sending to one IP
2256 * match later, which is more likely to be the
2280 * We sent npackets many packets to each of those
2306 * we add sequential 16 bit words to it, and at the end, fold
2322 * add back carry outs from top 16 bits to low 16 bits
2324 sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
2326 answer = ~sum; /* truncate to 16 bits */
2332 * Out is assumed to be >= in.
2369 /* if packet is big enough to store timeval AND ... */