summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ifmcstat/ifmcstat.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2007-03-20 02:08:28 +0000
committerbms <bms@FreeBSD.org>2007-03-20 02:08:28 +0000
commit9e60396f0b5b3f9528660fc36a77659620ab1c43 (patch)
tree5f40e14966e33faf35d32af10a77f0e95de74722 /usr.sbin/ifmcstat/ifmcstat.c
parente12c81ac96571afbe73dcd1bd087927688fb075a (diff)
downloadFreeBSD-src-9e60396f0b5b3f9528660fc36a77659620ab1c43.zip
FreeBSD-src-9e60396f0b5b3f9528660fc36a77659620ab1c43.tar.gz
Use -M and -N for core and kernel image respectively.
Diffstat (limited to 'usr.sbin/ifmcstat/ifmcstat.c')
-rw-r--r--usr.sbin/ifmcstat/ifmcstat.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c
index b2d1368..71f3ede 100644
--- a/usr.sbin/ifmcstat/ifmcstat.c
+++ b/usr.sbin/ifmcstat/ifmcstat.c
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-/* TODO: use -M, -N for kernel/namelist. */
/* TODO: use sysctl. */
#include <sys/cdefs.h>
@@ -151,12 +150,13 @@ int main(argc, argv)
int c;
struct ifnet *ifp, *nifp, ifnet;
const char *kernel = NULL;
+ const char *core = NULL;
/* "ifmcstat [kernel]" format is supported for backward compatiblity */
if (argc == 2)
kernel = argv[1];
- while ((c = getopt(argc, argv, "i:f:k:")) != -1) {
+ while ((c = getopt(argc, argv, "i:f:M:N:")) != -1) {
switch (c) {
case 'i':
if ((ifindex = if_nametoindex(optarg)) == 0) {
@@ -176,17 +176,22 @@ int main(argc, argv)
fprintf(stderr, "%s: unknown address family\n", optarg);
exit(1);
/*NOTREACHED*/
- case 'k':
+ case 'M':
+ core = strdup(optarg);
+ break;
+ case 'N':
kernel = strdup(optarg);
break;
default:
- fprintf(stderr, "usage: ifmcstat [-i interface] [-f address family] [-k kernel]\n");
+ fprintf(stderr,
+"usage: ifmcstat [-i interface] [-f address family] [-M core] [-N system]\n");
exit(1);
/*NOTREACHED*/
}
}
- if ((kvmd = kvm_openfiles(kernel, NULL, NULL, O_RDONLY, buf)) == NULL) {
+ if ((kvmd = kvm_openfiles(kernel, core, NULL, O_RDONLY, buf)) ==
+ NULL) {
perror("kvm_openfiles");
exit(1);
}
OpenPOWER on IntegriCloud