version 1.42, 2005/03/13 16:05:50 |
version 1.43, 2005/03/25 17:01:03 |
|
|
* the pointer to the TAILQ_HEAD with the actual pointer |
* the pointer to the TAILQ_HEAD with the actual pointer |
* to the first list element. |
* to the first list element. |
*/ |
*/ |
if (kread(ifnetaddr, (char *)&ifhead, sizeof ifhead)) |
if (kread(ifnetaddr, &ifhead, sizeof ifhead)) |
return; |
return; |
ifnetaddr = (u_long)ifhead.tqh_first; |
ifnetaddr = (u_long)ifhead.tqh_first; |
|
|
|
|
int n, m; |
int n, m; |
|
|
if (ifaddraddr == 0) { |
if (ifaddraddr == 0) { |
if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet)) |
if (kread(ifnetaddr, &ifnet, sizeof ifnet)) |
return; |
return; |
bcopy(ifnet.if_xname, name, IFNAMSIZ); |
bcopy(ifnet.if_xname, name, IFNAMSIZ); |
name[IFNAMSIZ - 1] = '\0'; /* sanity */ |
name[IFNAMSIZ - 1] = '\0'; /* sanity */ |
|
|
printf("%-11.11s ", "none"); |
printf("%-11.11s ", "none"); |
printf("%-17.17s ", "none"); |
printf("%-17.17s ", "none"); |
} else { |
} else { |
if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)) { |
if (kread(ifaddraddr, &ifaddr, sizeof ifaddr)) { |
ifaddraddr = 0; |
ifaddraddr = 0; |
continue; |
continue; |
} |
} |
|
|
|
|
multiaddr = (u_long)ifaddr.in.ia_multiaddrs.lh_first; |
multiaddr = (u_long)ifaddr.in.ia_multiaddrs.lh_first; |
while (multiaddr != 0) { |
while (multiaddr != 0) { |
kread(multiaddr, (char *)&inm, |
kread(multiaddr, &inm, sizeof inm); |
sizeof inm); |
|
printf("\n%25s %-17.17s ", "", |
printf("\n%25s %-17.17s ", "", |
routename(inm.inm_addr.s_addr)); |
routename(inm.inm_addr.s_addr)); |
multiaddr = (u_long)inm.inm_list.le_next; |
multiaddr = (u_long)inm.inm_list.le_next; |
|
|
|
|
multiaddr = (u_long)ifaddr.in6.ia6_multiaddrs.lh_first; |
multiaddr = (u_long)ifaddr.in6.ia6_multiaddrs.lh_first; |
while (multiaddr != 0) { |
while (multiaddr != 0) { |
kread(multiaddr, (char *)&inm, |
kread(multiaddr, &inm, sizeof inm); |
sizeof inm); |
|
memset(&m6, 0, sizeof(m6)); |
memset(&m6, 0, sizeof(m6)); |
m6.sin6_len = sizeof(struct sockaddr_in6); |
m6.sin6_len = sizeof(struct sockaddr_in6); |
m6.sin6_family = AF_INET6; |
m6.sin6_family = AF_INET6; |
|
|
* the pointer to the TAILQ_HEAD with the actual pointer |
* the pointer to the TAILQ_HEAD with the actual pointer |
* to the first list element. |
* to the first list element. |
*/ |
*/ |
if (kread(off, (char *)&ifhead, sizeof ifhead)) |
if (kread(off, &ifhead, sizeof ifhead)) |
return; |
return; |
firstifnet = (u_long)ifhead.tqh_first; |
firstifnet = (u_long)ifhead.tqh_first; |
|
|
|
|
total = sum - 1; |
total = sum - 1; |
interesting = (interface == NULL) ? iftot : NULL; |
interesting = (interface == NULL) ? iftot : NULL; |
for (off = firstifnet, ip = iftot; off;) { |
for (off = firstifnet, ip = iftot; off;) { |
if (kread(off, (char *)&ifnet, sizeof ifnet)) |
if (kread(off, &ifnet, sizeof ifnet)) |
break; |
break; |
bzero(ip->ift_name, sizeof(ip->ift_name)); |
bzero(ip->ift_name, sizeof(ip->ift_name)); |
snprintf(ip->ift_name, IFNAMSIZ, "%s", ifnet.if_xname); |
snprintf(ip->ift_name, IFNAMSIZ, "%s", ifnet.if_xname); |
|
|
sum->ift_co = 0; |
sum->ift_co = 0; |
sum->ift_dr = 0; |
sum->ift_dr = 0; |
for (off = firstifnet, ip = iftot; off && ip < lastif; ip++) { |
for (off = firstifnet, ip = iftot; off && ip < lastif; ip++) { |
if (kread(off, (char *)&ifnet, sizeof ifnet)) { |
if (kread(off, &ifnet, sizeof ifnet)) { |
off = 0; |
off = 0; |
continue; |
continue; |
} |
} |