struct nethost {
ip_t addr;
- ip_t addrs[MAXPATH]; /* for multi paths byMin */
+ ip_t addrs[MAXPATH]; /* for multi paths byMin */
int xmit;
int returned;
int sent;
int last;
int best;
int worst;
- int avg; /* average: addByMin */
- int gmean; /* geometric mean: addByMin */
- int jitter; /* current jitter, defined as t1-t0 addByMin */
- int javg; /* avg jitter */
- int jworst; /* max jitter */
- int jinta; /* estimated variance,? rfc1889's "Interarrival Jitter" */
+ int avg; /* average: addByMin */
+ int gmean; /* geometric mean: addByMin */
+ int jitter; /* current jitter, defined as t1-t0 addByMin */
+ int javg; /* avg jitter */
+ int jworst; /* max jitter */
+ int jinta; /* estimated variance,? rfc1889's "Interarrival Jitter" */
int transit;
int saved[SAVED_PINGS];
int saved_seq_offset;
}
-/* We got a return on something we sent out. Record the address and
- time. */
+/* We got a return on something we sent out. Record the address and
+ time. */
static void net_process_ping(
struct mtr_ctl *ctl,
int seq,
int totusec)
{
int index;
- int oldavg; /* usedByMin */
- int oldjavg; /* usedByMin */
- int i; /* usedByMin */
+ int oldavg; /* usedByMin */
+ int oldjavg; /* usedByMin */
+ int i; /* usedByMin */
#ifdef ENABLE_IPV6
char addrcopy[sizeof(struct in6_addr)];
#else
index = sequence[seq].index;
if ( addrcmp( (void *) &(host[index].addr),
- (void *) &ctl->unspec_addr, ctl->af ) == 0 ) {
+ (void *) &ctl->unspec_addr, ctl->af ) == 0 ) {
/* should be out of if as addr can change */
addrcpy( (void *) &(host[index].addr), addrcopy, ctl->af );
host[index].mpls = *mpls;
if( addrcmp( (void *) &(host[index].addrs[i]), (void *) &addrcopy,
ctl->af ) == 0 ||
addrcmp( (void *) &(host[index].addrs[i]),
- (void *) &ctl->unspec_addr, ctl->af ) == 0 ) break;
+ (void *) &ctl->unspec_addr, ctl->af ) == 0 ) break;
i++;
}
if( addrcmp( (void *) &(host[index].addrs[i]), addrcopy, ctl->af ) != 0 &&
if (totusec > host[index].worst) host[index].worst = totusec;
if (host[index].jitter > host[index].jworst)
- host[index].jworst = host[index].jitter;
+ host[index].jworst = host[index].jitter;
host[index].returned++;
oldavg = host[index].avg;
host[index].jinta += host[index].jitter - ((host[index].jinta + 8) >> 4);
if ( host[index].returned > 1 )
- host[index].gmean = pow( (double) host[index].gmean, (host[index].returned-1.0)/host[index].returned )
- * pow( (double) totusec, 1.0/host[index].returned );
+ host[index].gmean = pow( (double) host[index].gmean, (host[index].returned-1.0)/host[index].returned )
+ * pow( (double) totusec, 1.0/host[index].returned );
host[index].sent = 0;
host[index].up = 1;
host[index].transit = 0;
(void *) remoteaddress, ctl->af ) == 0 ) {
return at + 1;
} else if ( addrcmp( (void *) &(host[at].addr),
- (void *) &ctl->unspec_addr, ctl->af ) != 0 ) {
+ (void *) &ctl->unspec_addr, ctl->af ) != 0 ) {
max = at + 2;
}
}
*/
if( batch_at < ctl->fstTTL ) {
if( ctl->cpacketsize < 0 ) {
- /* Someone used a formula here that tried to correct for the
- "end-error" in "rand()". By "end-error" I mean that if you
- have a range for "rand()" that runs to 32768, and the
- destination range is 10000, you end up with 4 out of 32768
- 0-2768's and only 3 out of 32768 for results 2769 .. 9999.
- As our detination range (in the example 10000) is much
- smaller (reasonable packet sizes), and our rand() range much
- larger, this effect is insignificant. Oh! That other formula
- didn't work. */
+ /* Someone used a formula here that tried to correct for the
+ "end-error" in "rand()". By "end-error" I mean that if you
+ have a range for "rand()" that runs to 32768, and the
+ destination range is 10000, you end up with 4 out of 32768
+ 0-2768's and only 3 out of 32768 for results 2769 .. 9999.
+ As our detination range (in the example 10000) is much
+ smaller (reasonable packet sizes), and our rand() range much
+ larger, this effect is insignificant. Oh! That other formula
+ didn't work. */
packetsize = MINPACKET + rand () % (- ctl->cpacketsize - MINPACKET);
} else {
packetsize = ctl->cpacketsize;
n_unknown++;
/* The second condition in the next "if" statement was added in mtr-0.56,
- but I don't remember why. It makes mtr stop skipping sections of unknown
- hosts. Removed in 0.65.
- If the line proves necessary, it should at least NOT trigger that line
- when host[i].addr == 0 */
+ but I don't remember why. It makes mtr stop skipping sections of unknown
+ hosts. Removed in 0.65.
+ If the line proves necessary, it should at least NOT trigger that line
+ when host[i].addr == 0 */
if ( ( addrcmp( (void *) &(host[i].addr),
(void *) remoteaddress, ctl->af ) == 0 ))
n_unknown = MaxHost; /* Make sure we drop into "we should restart" */
}
- if ( /* success in reaching target */
+ if ( /* success in reaching target */
( addrcmp( (void *) &(host[batch_at].addr),
(void *) remoteaddress, ctl->af ) == 0 ) ||
/* fail in consecutive maxUnknown (firewall?) */
int at, i;
- batch_at = ctl->fstTTL - 1; /* above replacedByMin */
+ batch_at = ctl->fstTTL - 1; /* above replacedByMin */
numhosts = 10;
for (i = 0; i < SAVED_PINGS; i++)