]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
Replace all tabs tabs in net.c with spaces
authorJoe Bruggeman <joe@bruggeman.ca>
Thu, 26 Jan 2017 21:31:32 +0000 (16:31 -0500)
committerJoe Bruggeman <joe@bruggeman.ca>
Thu, 26 Jan 2017 21:32:44 +0000 (16:32 -0500)
Partial fix for #187

ui/net.c

index 31750cae7a1734f5e7476de53d69029101f796d7..25c16136a22c859a3d53b2b7de16fda11ca6f973 100644 (file)
--- a/ui/net.c
+++ b/ui/net.c
@@ -47,7 +47,7 @@ static void sockaddrtop( struct sockaddr * saddr, char * strptr, size_t len );
 
 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;
@@ -56,12 +56,12 @@ struct nethost {
   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;
@@ -164,8 +164,8 @@ static void net_send_query(struct mtr_ctl *ctl, int index, int packet_size)
 }
 
 
-/*   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,
@@ -174,9 +174,9 @@ static void net_process_ping(
   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
@@ -195,7 +195,7 @@ static void net_process_ping(
   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;
@@ -209,7 +209,7 @@ static void net_process_ping(
       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 && 
@@ -235,7 +235,7 @@ static void net_process_ping(
   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;
@@ -248,8 +248,8 @@ static void net_process_ping(
   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;
@@ -379,7 +379,7 @@ int net_max(struct mtr_ctl *ctl)
                   (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;
     }
   }
@@ -436,15 +436,15 @@ int net_send_batch(struct mtr_ctl *ctl)
   */
   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;
@@ -461,16 +461,16 @@ int net_send_batch(struct mtr_ctl *ctl)
       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?) */
@@ -636,7 +636,7 @@ void net_reset(struct mtr_ctl *ctl)
 
   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++)