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

Diff for /src/usr.bin/netstat/inet.c between version 1.92 and 1.93

version 1.92, 2005/02/10 14:25:08 version 1.93, 2005/03/25 17:01:03
Line 138 
Line 138 
                 return;                  return;
         istcp = strcmp(name, "tcp") == 0;          istcp = strcmp(name, "tcp") == 0;
         israw = strncmp(name, "ip", 2) == 0;          israw = strncmp(name, "ip", 2) == 0;
         kread(off, (char *)&table, sizeof table);          kread(off, &table, sizeof table);
         prev = head =          prev = head =
             (struct inpcb *)&((struct inpcbtable *)off)->inpt_queue.cqh_first;              (struct inpcb *)&((struct inpcbtable *)off)->inpt_queue.cqh_first;
         next = table.inpt_queue.cqh_first;          next = table.inpt_queue.cqh_first;
   
         while (next != head) {          while (next != head) {
                 kread((u_long)next, (char *)&inpcb, sizeof inpcb);                  kread((u_long)next, &inpcb, sizeof inpcb);
                 if (inpcb.inp_queue.cqe_prev != prev) {                  if (inpcb.inp_queue.cqe_prev != prev) {
                         printf("???\n");                          printf("???\n");
                         break;                          break;
Line 168 
Line 168 
                 if (!aflag &&                  if (!aflag &&
                     inet_lnaof(inpcb.inp_laddr) == INADDR_ANY)                      inet_lnaof(inpcb.inp_laddr) == INADDR_ANY)
                         continue;                          continue;
                 kread((u_long)inpcb.inp_socket, (char *)&sockb, sizeof (sockb));                  kread((u_long)inpcb.inp_socket, &sockb, sizeof (sockb));
                 if (istcp) {                  if (istcp) {
                         kread((u_long)inpcb.inp_ppcb,                          kread((u_long)inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
                             (char *)&tcpcb, sizeof (tcpcb));  
                 }                  }
                 if (first) {                  if (first) {
                         printf("Active Internet connections");                          printf("Active Internet connections");
Line 250 
Line 249 
         if (off == 0)          if (off == 0)
                 return;                  return;
         printf("%s:\n", name);          printf("%s:\n", name);
         kread(off, (char *)&tcpstat, sizeof (tcpstat));          kread(off, &tcpstat, sizeof (tcpstat));
   
 #define p(f, m) if (tcpstat.f || sflag <= 1) \  #define p(f, m) if (tcpstat.f || sflag <= 1) \
         printf(m, tcpstat.f, plural(tcpstat.f))          printf(m, tcpstat.f, plural(tcpstat.f))
Line 366 
Line 365 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&udpstat, sizeof (udpstat));          kread(off, &udpstat, sizeof (udpstat));
         printf("%s:\n", name);          printf("%s:\n", name);
 #define p(f, m) if (udpstat.f || sflag <= 1) \  #define p(f, m) if (udpstat.f || sflag <= 1) \
         printf(m, udpstat.f, plural(udpstat.f))          printf(m, udpstat.f, plural(udpstat.f))
Line 406 
Line 405 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&ipstat, sizeof (ipstat));          kread(off, &ipstat, sizeof (ipstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (ipstat.f || sflag <= 1) \  #define p(f, m) if (ipstat.f || sflag <= 1) \
Line 504 
Line 503 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&icmpstat, sizeof (icmpstat));          kread(off, &icmpstat, sizeof (icmpstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (icmpstat.f || sflag <= 1) \  #define p(f, m) if (icmpstat.f || sflag <= 1) \
Line 555 
Line 554 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&igmpstat, sizeof (igmpstat));          kread(off, &igmpstat, sizeof (igmpstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (igmpstat.f || sflag <= 1) \  #define p(f, m) if (igmpstat.f || sflag <= 1) \
Line 586 
Line 585 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         if (kread(off, (char *)&pimstat, sizeof (pimstat)) != 0) {          if (kread(off, &pimstat, sizeof (pimstat)) != 0) {
                 /* XXX: PIM is probably not enabled in the kernel */                  /* XXX: PIM is probably not enabled in the kernel */
                 return;                  return;
         }          }
Line 637 
Line 636 
   
         if (first == 0) {          if (first == 0) {
                 first = 1;                  first = 1;
                 memset((char *)&server_addr, 0, sizeof server_addr);                  memset(&server_addr, 0, sizeof server_addr);
                 server_addr.sin_family = AF_INET;                  server_addr.sin_family = AF_INET;
                 if ((hp = gethostbyname("localhost")) != NULL)                  if ((hp = gethostbyname("localhost")) != NULL)
                         memmove((caddr_t)&server_addr.sin_addr, hp->h_addr,                          memmove((caddr_t)&server_addr.sin_addr, hp->h_addr,
Line 779 
Line 778 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&ahstat, sizeof (ahstat));          kread(off, &ahstat, sizeof (ahstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (ahstat.f || sflag <= 1) \  #define p(f, m) if (ahstat.f || sflag <= 1) \
Line 820 
Line 819 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&etheripstat, sizeof (etheripstat));          kread(off, &etheripstat, sizeof (etheripstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (etheripstat.f || sflag <= 1) \  #define p(f, m) if (etheripstat.f || sflag <= 1) \
Line 848 
Line 847 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&espstat, sizeof (espstat));          kread(off, &espstat, sizeof (espstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (espstat.f || sflag <= 1) \  #define p(f, m) if (espstat.f || sflag <= 1) \
Line 890 
Line 889 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&ipipstat, sizeof (ipipstat));          kread(off, &ipipstat, sizeof (ipipstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (ipipstat.f || sflag <= 1) \  #define p(f, m) if (ipipstat.f || sflag <= 1) \
Line 919 
Line 918 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&carpstat, sizeof(carpstat));          kread(off, &carpstat, sizeof(carpstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (carpstat.f || sflag <= 1) \  #define p(f, m) if (carpstat.f || sflag <= 1) \
Line 955 
Line 954 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&pfsyncstat, sizeof(pfsyncstat));          kread(off, &pfsyncstat, sizeof(pfsyncstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (pfsyncstat.f || sflag <= 1) \  #define p(f, m) if (pfsyncstat.f || sflag <= 1) \
Line 993 
Line 992 
   
         if (off == 0)          if (off == 0)
                 return;                  return;
         kread(off, (char *)&ipcompstat, sizeof (ipcompstat));          kread(off, &ipcompstat, sizeof (ipcompstat));
         printf("%s:\n", name);          printf("%s:\n", name);
   
 #define p(f, m) if (ipcompstat.f || sflag <= 1) \  #define p(f, m) if (ipcompstat.f || sflag <= 1) \

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.93