netstat(1) and ifmcstat(8): ifnet was renamed to ifnet_list, PR/48850.
This commit is contained in:
parent
2e958a7003
commit
2286cc983b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: main.c,v 1.90 2014/04/28 15:41:15 christos Exp $ */
|
||||
/* $NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1988, 1993
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\
|
|||
#if 0
|
||||
static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.90 2014/04/28 15:41:15 christos Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -79,8 +79,8 @@ struct nlist nl[] = {
|
|||
{ "_udbtable", 0, 0, 0, 0 },
|
||||
#define N_UDPSTAT 5
|
||||
{ "_udpstat", 0, 0, 0, 0 }, /* not available via kvm */
|
||||
#define N_IFNET 6
|
||||
{ "_ifnet", 0, 0, 0, 0 },
|
||||
#define N_IFNET_LIST 6
|
||||
{ "_ifnet_list", 0, 0, 0, 0 },
|
||||
#define N_ICMPSTAT 7
|
||||
{ "_icmpstat", 0, 0, 0, 0 }, /* not available via kvm */
|
||||
#define N_RTSTAT 8
|
||||
|
@ -570,7 +570,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
if (pflag) {
|
||||
if (iflag && tp->pr_istats)
|
||||
intpr(interval, nl[N_IFNET].n_value, tp->pr_istats);
|
||||
intpr(interval, nl[N_IFNET_LIST].n_value, tp->pr_istats);
|
||||
else if (tp->pr_stats)
|
||||
(*tp->pr_stats)(nl[tp->pr_sindex].n_value,
|
||||
tp->pr_name);
|
||||
|
@ -624,7 +624,7 @@ main(int argc, char *argv[])
|
|||
if (af != AF_UNSPEC)
|
||||
goto protostat;
|
||||
|
||||
intpr(interval, nl[N_IFNET].n_value, NULL);
|
||||
intpr(interval, nl[N_IFNET_LIST].n_value, NULL);
|
||||
break;
|
||||
}
|
||||
if (rflag) {
|
||||
|
@ -723,7 +723,7 @@ printproto(struct protox *tp, const char *name)
|
|||
if (sflag) {
|
||||
if (iflag) {
|
||||
if (tp->pr_istats)
|
||||
intpr(interval, nl[N_IFNET].n_value,
|
||||
intpr(interval, nl[N_IFNET_LIST].n_value,
|
||||
tp->pr_istats);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ifmcstat.c,v 1.12 2013/10/19 17:16:25 christos Exp $ */
|
||||
/* $NetBSD: ifmcstat.c,v 1.13 2014/05/30 01:44:21 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -65,8 +65,8 @@
|
|||
kvm_t *kvmd;
|
||||
|
||||
struct nlist nl[] = {
|
||||
#define N_IFNET 0
|
||||
{ "_ifnet", 0, 0, 0, 0 },
|
||||
#define N_IFNET_LIST 0
|
||||
{ "_ifnet_list", 0, 0, 0, 0 },
|
||||
#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
|
||||
#define N_IN6_MK 1
|
||||
{ "_in6_mk", 0, 0, 0, 0 },
|
||||
|
@ -149,11 +149,11 @@ int main()
|
|||
perror("kvm_nlist");
|
||||
exit(1);
|
||||
}
|
||||
if (nl[N_IFNET].n_value == 0) {
|
||||
printf("symbol %s not found\n", nl[N_IFNET].n_name);
|
||||
if (nl[N_IFNET_LIST].n_value == 0) {
|
||||
printf("symbol %s not found\n", nl[N_IFNET_LIST].n_name);
|
||||
exit(1);
|
||||
}
|
||||
KREAD(nl[N_IFNET].n_value, &ifp, struct ifnet *);
|
||||
KREAD(nl[N_IFNET_LIST].n_value, &ifp, struct ifnet *);
|
||||
while (ifp) {
|
||||
KREAD(ifp, &ifnet, struct ifnet);
|
||||
printf("%s:\n", if_indextoname(ifnet.if_index, ifnam));
|
||||
|
|
Loading…
Reference in New Issue