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

Diff for /src/usr.bin/systat/pf.c between version 1.9 and 1.10

version 1.9, 2017/06/01 14:38:28 version 1.10, 2019/05/09 15:01:09
Line 16 
Line 16 
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
   #include <sys/sysctl.h>
 #include <sys/ioctl.h>  #include <sys/ioctl.h>
 #include <sys/socket.h>  #include <sys/socket.h>
 #include <sys/signal.h>  #include <sys/signal.h>
Line 46 
Line 47 
 const char      *pf_scounters[FCNT_MAX+1] = FCNT_NAMES;  const char      *pf_scounters[FCNT_MAX+1] = FCNT_NAMES;
   
 static struct pf_status status;  static struct pf_status status;
 extern int pf_dev;  
 int num_pf = 0;  int num_pf = 0;
   
 field_def fields_pf[] = {  field_def fields_pf[] = {
Line 91 
Line 91 
 int  int
 read_pf(void)  read_pf(void)
 {  {
         if (pf_dev < 0) {          size_t size = sizeof(status);
                 num_disp = 0;          int mib[3] = { CTL_KERN, KERN_PFSTATUS };
                 return 0;  
         }  
   
         if (ioctl(pf_dev, DIOCGETSTATUS, &status)) {          if (sysctl(mib, 2, &status, &size, NULL, 0) < 0) {
                 error("DIOCGETSTATUS: %s", strerror(errno));                  error("sysctl(PFCTL_STATUS): %s", strerror(errno));
                 return (-1);                  return (-1);
         }          }
   

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10