Add netstat command

This adds the netstat command. All but one file is currently enabled.
That file does not currently build.

Also added libmemstat and libutil. libmemstat had a lot of code related
to kvm and kernel memory access disabled. This may or may not be an
issue.
This commit is contained in:
Joel Sherrill
2012-10-17 11:13:36 -05:00
parent 99ae4eb50f
commit b6ac989f8a
21 changed files with 3105 additions and 12 deletions

View File

@@ -56,12 +56,10 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <err.h>
#ifdef __rtems__
/* XXX what to do? */
#else
#ifndef __rtems__
#include <kvm.h>
#include <memstat.h>
#endif
#include <memstat.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -110,6 +108,7 @@ mbpr(void *kvmd, u_long mbaddr)
goto out;
}
} else {
#ifndef __rtems__
if (memstat_kvm_all(mtlp, kvmd) < 0) {
error = memstat_mtl_geterror(mtlp);
if (error == MEMSTAT_ERROR_KVM)
@@ -120,6 +119,7 @@ mbpr(void *kvmd, u_long mbaddr)
memstat_strerror(error));
goto out;
}
#endif
}
mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_MEM_NAME);