[BACK]Return to pftop.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / systat

Diff for /src/usr.bin/systat/pftop.c between version 1.5 and 1.6

version 1.5, 2008/09/01 23:30:08 version 1.6, 2008/10/08 15:11:13
Line 58 
Line 58 
 #include <unistd.h>  #include <unistd.h>
 #include <stdarg.h>  #include <stdarg.h>
   
   #include "systat.h"
 #include "engine.h"  #include "engine.h"
 #include "cache.h"  #include "cache.h"
   
Line 1516 
Line 1517 
                         prev->next = node;                          prev->next = node;
                 }                  }
         }          }
         if (*root != node) {  }
                 struct pf_altq_node     *prev_flat = *root;  
                 while (prev_flat->next_flat != NULL) {  void
                         prev_flat = prev_flat->next_flat;  pfctl_set_next_flat(struct pf_altq_node *node, struct pf_altq_node *up)
                 }  {
                 prev_flat->next_flat = node;          while (node) {
                   struct pf_altq_node *next = node->next ? node->next : up;
                   if (node->children) {
                           node->next_flat = node->children;
                           pfctl_set_next_flat(node->children, next);
                   } else
                           node->next_flat = next;
                   node = node->next;
         }          }
 }  }
   
Line 1534 
Line 1542 
         u_int32_t                nr;          u_int32_t                nr;
         struct queue_stats       qstats;          struct queue_stats       qstats;
         u_int32_t                nr_queues;          u_int32_t                nr_queues;
           int                      ret = 0;
   
         *inserts = 0;          *inserts = 0;
         memset(&pa, 0, sizeof(pa));          memset(&pa, 0, sizeof(pa));
Line 1547 
Line 1556 
                 error("DIOCGETALTQS: %s", strerror(errno));                  error("DIOCGETALTQS: %s", strerror(errno));
                 return (-1);                  return (-1);
         }          }
   
         num_queues = nr_queues = pa.nr;          num_queues = nr_queues = pa.nr;
         for (nr = 0; nr < nr_queues; ++nr) {          for (nr = 0; nr < nr_queues; ++nr) {
                 pa.nr = nr;                  pa.nr = nr;
                 if (ioctl(pf_dev, DIOCGETALTQ, &pa)) {                  if (ioctl(pf_dev, DIOCGETALTQ, &pa)) {
                         error("DIOCGETALTQ: %s", strerror(errno));                          error("DIOCGETALTQ: %s", strerror(errno));
                         return (-1);                          ret = -1;
                           break;
                 }                  }
                 if (pa.altq.qid > 0) {                  if (pa.altq.qid > 0) {
                         pq.nr = nr;                          pq.nr = nr;
Line 1561 
Line 1572 
                         pq.nbytes = sizeof(qstats);                          pq.nbytes = sizeof(qstats);
                         if (ioctl(pf_dev, DIOCGETQSTATS, &pq)) {                          if (ioctl(pf_dev, DIOCGETQSTATS, &pq)) {
                                 error("DIOCGETQSTATS: %s", strerror(errno));                                  error("DIOCGETQSTATS: %s", strerror(errno));
                                 return (-1);                                  ret = -1;
                                   break;
                         }                          }
                         qstats.valid = 1;                          qstats.valid = 1;
                         gettimeofday(&qstats.timestamp, NULL);                          gettimeofday(&qstats.timestamp, NULL);
Line 1582 
Line 1594 
                 else                  else
                         --num_queues;                          --num_queues;
         }          }
         return (0);  
           pfctl_set_next_flat(*root, NULL);
   
           return (ret);
 }  }
   
 void  void

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6