version 1.92, 2005/02/10 14:25:08 |
version 1.93, 2005/03/25 17:01:03 |
|
|
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; |
|
|
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"); |
|
|
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)) |
|
|
|
|
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)) |
|
|
|
|
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) \ |
|
|
|
|
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) \ |
|
|
|
|
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) \ |
|
|
|
|
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; |
} |
} |
|
|
|
|
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, |
|
|
|
|
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) \ |
|
|
|
|
if (off == 0) |
if (off == 0) |
return; |
return; |
kread(off, (char *)ðeripstat, sizeof (etheripstat)); |
kread(off, ðeripstat, 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) \ |
|
|
|
|
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) \ |
|
|
|
|
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) \ |
|
|
|
|
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) \ |
|
|
|
|
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) \ |
|
|
|
|
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) \ |