diff options
author | oliver <oliver@FreeBSD.org> | 2005-07-31 09:16:03 +0800 |
---|---|---|
committer | oliver <oliver@FreeBSD.org> | 2005-07-31 09:16:03 +0800 |
commit | 05020fc231301ba5d06cce2c02fe8422ef1c7574 (patch) | |
tree | 98c29f304484d68af2e521d6936e87f534517c40 /net/bpfstat | |
parent | 5353435ca8a12a5fd8a74e28ff9e994bf78fc925 (diff) | |
download | freebsd-ports-gnome-05020fc231301ba5d06cce2c02fe8422ef1c7574.tar.gz freebsd-ports-gnome-05020fc231301ba5d06cce2c02fe8422ef1c7574.tar.zst freebsd-ports-gnome-05020fc231301ba5d06cce2c02fe8422ef1c7574.zip |
add bpfstat - a program to retrieve bpf statistics
Submitted by: csjp
Diffstat (limited to 'net/bpfstat')
-rw-r--r-- | net/bpfstat/Makefile | 25 | ||||
-rw-r--r-- | net/bpfstat/distinfo | 2 | ||||
-rw-r--r-- | net/bpfstat/lala | 57 | ||||
-rw-r--r-- | net/bpfstat/pkg-descr | 6 |
4 files changed, 90 insertions, 0 deletions
diff --git a/net/bpfstat/Makefile b/net/bpfstat/Makefile new file mode 100644 index 000000000000..c18498036066 --- /dev/null +++ b/net/bpfstat/Makefile @@ -0,0 +1,25 @@ +# New ports collection makefile for: bpfstat +# Date created: 27 July 2005 +# Whom: Christian S.J. Peron <csjp@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= bpfstat +PORTVERSION= 1.0 +CATEGORIES= net +MASTER_SITES= http://people.freebsd.org/~csjp/ + +MAINTAINER= csjp@FreeBSD.org +COMMENT= Program to retrieve bpf statistics + +MAN8= bpfstat.8 +PLIST_FILES= sbin/bpfstat + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} < 600033 +IGNORE= will only work on systems >= 600033 +.endif + +.include <bsd.port.post.mk> diff --git a/net/bpfstat/distinfo b/net/bpfstat/distinfo new file mode 100644 index 000000000000..930997a17b57 --- /dev/null +++ b/net/bpfstat/distinfo @@ -0,0 +1,2 @@ +MD5 (bpfstat-1.0.tar.gz) = 2923d3b59adf222e78d11823d31e0a93 +SIZE (bpfstat-1.0.tar.gz) = 3442 diff --git a/net/bpfstat/lala b/net/bpfstat/lala new file mode 100644 index 000000000000..24224838ae13 --- /dev/null +++ b/net/bpfstat/lala @@ -0,0 +1,57 @@ +@@ -33,7 +33,7 @@ + * + * @(#)bpfdesc.h 8.1 (Berkeley) 6/10/93 + * +- * $FreeBSD: /tmp/pcvs/ports/net/bpfstat/Attic/lala,v 1.1 2005-07-31 01:16:03 oliver Exp $ ++ * $FreeBSD: /tmp/pcvs/ports/net/bpfstat/Attic/lala,v 1.1 2005-07-31 01:16:03 oliver Exp $ + */ + + #ifndef _NET_BPFDESC_H_ +@@ -42,6 +42,8 @@ + #include <sys/callout.h> + #include <sys/selinfo.h> + #include <sys/queue.h> ++#include <sys/conf.h> ++#include <net/if.h> + + /* + * Descriptor associated with each open bpf file. +@@ -90,6 +92,9 @@ struct bpf_d { + struct mtx bd_mtx; /* mutex for this descriptor */ + struct callout bd_callout; /* for BPF timeouts with select */ + struct label *bd_label; /* MAC label for descriptor */ ++ u_long bd_fcount; /* number of packets which matched filter */ ++ pid_t bd_pid; /* PID which created descriptor */ ++ char bd_pcomm[MAXCOMLEN + 1]; + }; + + /* Values for bd_state */ +@@ -121,6 +126,27 @@ struct bpf_if { + u_int bif_hdrlen; /* length of header (with padding) */ + struct ifnet *bif_ifp; /* corresponding interface */ + struct mtx bif_mtx; /* mutex for interface */ ++}; ++ ++/* ++ * External representation of the bpf descriptor ++ */ ++struct xbpf_d { ++ u_char bd_promisc; ++ u_char bd_immediate; ++ int bd_hdrcmplt; ++ int bd_seesent; ++ int bd_async; ++ u_long bd_rcount; ++ u_long bd_dcount; ++ u_long bd_fcount; ++ int bd_sig; ++ int bd_slen; ++ int bd_hlen; ++ int bd_bufsize; ++ pid_t bd_pid; ++ char bd_ifname[IFNAMSIZ]; ++ char bd_pcomm[MAXCOMLEN + 1]; + }; + + #define BPFIF_LOCK(bif) mtx_lock(&(bif)->bif_mtx) + diff --git a/net/bpfstat/pkg-descr b/net/bpfstat/pkg-descr new file mode 100644 index 000000000000..92dfa13e483a --- /dev/null +++ b/net/bpfstat/pkg-descr @@ -0,0 +1,6 @@ +The bpfstat utility will print statistics associated with active bpf(4) +devices. These statistics contain information about device state as well +as packets which have been received, dropped or matched by the bpf filter +program. + +WWW: http://people.freebsd.org/~csjp/ |