[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.121 and 1.122

version 1.121, 2013/02/05 13:58:02 version 1.122, 2013/03/20 15:23:37
Line 199 
Line 199 
                 }                  }
                 if (Aflag) {                  if (Aflag) {
                         if (istcp)                          if (istcp)
                                 printf("%*p ", PLEN, inpcb.inp_ppcb);                                  printf("%*p ", PLEN, hideroot ? 0 : inpcb.inp_ppcb);
                         else                          else
                                 printf("%*p ", PLEN, prev);                                  printf("%*p ", PLEN, hideroot ? 0 : prev);
                 }                  }
                 if (inpcb.inp_flags & INP_IPV6 && !israw) {                  if (inpcb.inp_flags & INP_IPV6 && !israw) {
                         strlcpy(namebuf, name0, sizeof namebuf);                          strlcpy(namebuf, name0, sizeof namebuf);
Line 1175 
Line 1175 
         kread(off, &so, sizeof(so));          kread(off, &so, sizeof(so));
   
 #define p(fmt, v, sep) printf(#v " " fmt sep, so.v);  #define p(fmt, v, sep) printf(#v " " fmt sep, so.v);
         printf("socket %#lx\n ", off);  #define pp(fmt, v, sep) printf(#v " " fmt sep, hideroot ? 0 : so.v);
           printf("socket %#lx\n ", hideroot ? 0 : off);
         p("%#0.4x", so_type, "\n ");          p("%#0.4x", so_type, "\n ");
         p("%#0.4x", so_options, "\n ");          p("%#0.4x", so_options, "\n ");
         p("%d", so_linger, "\n ");          p("%d", so_linger, "\n ");
         p("%#0.4x", so_state, "\n ");          p("%#0.4x", so_state, "\n ");
         p("%p", so_pcb, ", ");          pp("%p", so_pcb, ", ");
         p("%p", so_proto, ", ");          pp("%p", so_proto, ", ");
         p("%p", so_head, "\n ");          pp("%p", so_head, "\n ");
         p("%d", so_q0len, ", ");          p("%d", so_q0len, ", ");
         p("%d", so_qlen, ", ");          p("%d", so_qlen, ", ");
         p("%d", so_qlimit, "\n ");          p("%d", so_qlimit, "\n ");
Line 1192 
Line 1193 
         p("%u", so_siguid, ", ");          p("%u", so_siguid, ", ");
         p("%u", so_sigeuid, "\n ");          p("%u", so_sigeuid, "\n ");
         p("%lu", so_oobmark, "\n ");          p("%lu", so_oobmark, "\n ");
         p("%p", so_splice, ", ");          pp("%p", so_splice, ", ");
         p("%p", so_spliceback, "\n ");          pp("%p", so_spliceback, "\n ");
         p("%lld", so_splicelen, ", ");          p("%lld", so_splicelen, ", ");
         p("%lld", so_splicemax, ", ");          p("%lld", so_splicemax, ", ");
         p("%ld", so_idletv.tv_sec, ", ");          p("%ld", so_idletv.tv_sec, ", ");
Line 1206 
Line 1207 
         p("%u", so_rgid, "\n ");          p("%u", so_rgid, "\n ");
         p("%d", so_cpid, "\n");          p("%d", so_cpid, "\n");
 #undef  p  #undef  p
   #undef  pp
   
         if (!vflag)          if (!vflag)
                 return;                  return;
Line 1248 
Line 1250 
         kread(off, &proto, sizeof(proto));          kread(off, &proto, sizeof(proto));
   
 #define p(fmt, v, sep) printf(#v " " fmt sep, proto.v);  #define p(fmt, v, sep) printf(#v " " fmt sep, proto.v);
         printf("protosw %#lx\n ", off);  #define pp(fmt, v, sep) printf(#v " " fmt sep, hideroot ? 0 : proto.v);
           printf("protosw %#lx\n ", hideroot ? 0 : off);
         p("%#0.4x", pr_type, "\n ");          p("%#0.4x", pr_type, "\n ");
         p("%p", pr_domain, "\n ");          pp("%p", pr_domain, "\n ");
         p("%d", pr_protocol, "\n ");          p("%d", pr_protocol, "\n ");
         p("%#0.4x", pr_flags, "\n");          p("%#0.4x", pr_flags, "\n");
 #undef  p  #undef  p
   #undef  pp
   
         domain_dump((u_long)proto.pr_domain, pcb, proto.pr_protocol);          domain_dump((u_long)proto.pr_domain, pcb, proto.pr_protocol);
 }  }
Line 1273 
Line 1277 
         kread((u_long)dom.dom_name, name, sizeof(name));          kread((u_long)dom.dom_name, name, sizeof(name));
   
 #define p(fmt, v, sep) printf(#v " " fmt sep, dom.v);  #define p(fmt, v, sep) printf(#v " " fmt sep, dom.v);
         printf("domain %#lx\n ", off);          printf("domain %#lx\n ", hideroot ? 0 : off);
         p("%d", dom_family, "\n ");          p("%d", dom_family, "\n ");
         printf("dom_name %.*s\n", sizeof(name), name);          printf("dom_name %.*s\n", sizeof(name), name);
 #undef  p  #undef  p
Line 1315 
Line 1319 
         }          }
   
 #define p(fmt, v, sep) printf(#v " " fmt sep, inp.v);  #define p(fmt, v, sep) printf(#v " " fmt sep, inp.v);
         printf("inpcb %#lx\n ", off);  #define pp(fmt, v, sep) printf(#v " " fmt sep, hideroot ? 0 : inp.v);
         p("%p", inp_table, "\n ");          printf("inpcb %#lx\n ", hideroot ? 0 : off);
           pp("%p", inp_table, "\n ");
         printf("inp_faddru %s, inp_laddru %s\n ", faddr, laddr);          printf("inp_faddru %s, inp_laddru %s\n ", faddr, laddr);
         HTONS(inp.inp_fport);          HTONS(inp.inp_fport);
         HTONS(inp.inp_lport);          HTONS(inp.inp_lport);
         p("%u", inp_fport, ", ");          p("%u", inp_fport, ", ");
         p("%u", inp_lport, "\n ");          p("%u", inp_lport, "\n ");
         p("%p", inp_socket, ", ");          pp("%p", inp_socket, ", ");
         p("%p", inp_ppcb, "\n ");          pp("%p", inp_ppcb, "\n ");
         p("%#0.8x", inp_flags, "\n ");          p("%#0.8x", inp_flags, "\n ");
         p("%d", inp_hops, "\n ");          p("%d", inp_hops, "\n ");
         p("%u", inp_seclevel[0], ", ");          p("%u", inp_seclevel[0], ", ");
Line 1333 
Line 1338 
         p("%#x", inp_secrequire, ", ");          p("%#x", inp_secrequire, ", ");
         p("%#x", inp_secresult, "\n ");          p("%#x", inp_secresult, "\n ");
         p("%u", inp_ip_minttl, "\n ");          p("%u", inp_ip_minttl, "\n ");
         p("%p", inp_tdb_in, ", ");          pp("%p", inp_tdb_in, ", ");
         p("%p", inp_tdb_out, ", ");          pp("%p", inp_tdb_out, ", ");
         p("%p", inp_ipo, "\n ");          pp("%p", inp_ipo, "\n ");
         p("%p", inp_ipsec_remotecred, ", ");          pp("%p", inp_ipsec_remotecred, ", ");
         p("%p", inp_ipsec_remoteauth, "\n ");          pp("%p", inp_ipsec_remoteauth, "\n ");
         p("%d", in6p_cksum, "\n ");          p("%d", in6p_cksum, "\n ");
         p("%p", inp_icmp6filt, "\n ");          pp("%p", inp_icmp6filt, "\n ");
         p("%p", inp_pf_sk, "\n ");          pp("%p", inp_pf_sk, "\n ");
         p("%u", inp_rtableid, "\n ");          p("%u", inp_rtableid, "\n ");
         p("%d", inp_pipex, "\n");          p("%d", inp_pipex, "\n");
 #undef  p  #undef  p
   #undef  pp
   
         switch (protocol) {          switch (protocol) {
         case IPPROTO_TCP:          case IPPROTO_TCP:
Line 1365 
Line 1371 
         kread(off, (char *)&tcpcb, sizeof (tcpcb));          kread(off, (char *)&tcpcb, sizeof (tcpcb));
   
 #define p(fmt, v, sep) printf(#v " " fmt sep, tcpcb.v);  #define p(fmt, v, sep) printf(#v " " fmt sep, tcpcb.v);
         printf("tcpcb %#lx\n ", off);  #define pp(fmt, v, sep) printf(#v " " fmt sep, hideroot ? 0 : tcpcb.v);
         p("%p", t_inpcb, "\n ");          printf("tcpcb %#lx\n ", hideroot ? 0 : off);
           pp("%p", t_inpcb, "\n ");
         p("%d", t_state, "");          p("%d", t_state, "");
         if (tcpcb.t_state >= 0 && tcpcb.t_state < TCP_NSTATES)          if (tcpcb.t_state >= 0 && tcpcb.t_state < TCP_NSTATES)
                 printf(" (%s)", tcpstates[tcpcb.t_state]);                  printf(" (%s)", tcpstates[tcpcb.t_state]);
Line 1429 
Line 1436 
         p("%u", t_pmtud_th_seq, "\n ");          p("%u", t_pmtud_th_seq, "\n ");
         p("%u", pf, "\n");          p("%u", pf, "\n");
 #undef  p  #undef  p
   #undef  pp
 }  }

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.122