NetBSD/sys/net
christos 224c697f91 Patch from Dheeraj S, inspired by the following FreeBSD change:
Rather than calling mircotime() in catchpacket(), make catchpacket()
take a timeval indicating when the packet was captured. Move
microtime() to the calling functions and grab the timestamp as soon
as we know that we're going to call catchpacket at least once.

This means that we call microtime() once per matched packet, as
opposed to once per matched packet per bpf listener. It also means
that we return the same timestamp to all bpf listeners, rather than
slightly different ones.

It would be more accurate to call microtime() even earlier for all
packets, as you have to grab (1+#listener) locks before you can
determine if the packet will be logged. You could always grab a
timestamp before the locks, but microtime() can be costly, so this
didn't seem like a good idea.

(I guess most ethernet interfaces will have a bpf listener these
days because of dhclient. That means that we could be doing two bpf
locks on most packets going through the interface.)
2006-07-26 13:54:13 +00:00
..
agr make a multiple inclusion protection macro match with the filename. 2006-07-08 05:57:41 +00:00
bpf_filter.c XXX: GCC uninitialized. 2006-05-14 05:30:31 +00:00
bpf.c Patch from Dheeraj S, inspired by the following FreeBSD change: 2006-07-26 13:54:13 +00:00
bpf.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
bpfdesc.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
bridgestp.c Coverity CID 2728: Add KASSERT before NULL deref. 2006-04-15 02:38:19 +00:00
bsd-comp.c ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
dlt.h add missing DLTs from the libpcap-0.9.4 distribution 2006-02-27 14:22:26 +00:00
ethertypes.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
files.pf merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
if_arc.h argument type conflict. 2005-12-14 00:28:08 +00:00
if_arcsubr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_arp.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_atm.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_atmsubr.c ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_bridge.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_bridgevar.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_dl.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_eco.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_ecosubr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_ether.h Add a new function called ether_snprintf() which takes an external buffer 2006-03-16 15:57:59 +00:00
if_ethersubr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_faith.c Replace the comment that came from if_loop.c many years ago by 2006-01-31 22:27:15 +00:00
if_faith.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_fddi.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_fddisubr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_gif.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_gif.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_gre.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_gre.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_hippi.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_hippisubr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_ieee1394.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_ieee1394subr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_llc.h Comment out packed attributes that gcc 4 does not like. 2006-05-14 02:45:45 +00:00
if_loop.c ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_media.c merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
if_media.h Add IFM_10G_SR and IFM_10G_CX4, to keep in sync with FreeBSD. 2006-06-03 12:43:28 +00:00
if_ppp.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_ppp.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_pppoe.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_pppoe.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_pppvar.h Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_sl.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_slvar.h merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_sppp.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_spppsubr.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_spppvar.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_stf.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_stf.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_strip.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_stripvar.h merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_tap.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_tap.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
if_token.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
if_tokensubr.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
if_tun.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_tun.h Change the number of TUN[GS]IFHEAD to avoid collision with if_pp. 2006-04-04 11:23:59 +00:00
if_types.h Integrate Common Address Redundancy Procotol (CARP) from OpenBSD 2006-05-18 09:05:49 +00:00
if_vlan.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if_vlanvar.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
if.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
if.h add a comment on if_agrprivate. 2006-06-25 07:50:00 +00:00
Makefile Do not instal net/if_pppvar.h, net/if_slvar.h and net/if_stripvar.h. 2006-06-18 21:02:16 +00:00
net_osdep.h Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
netisr_dispatch.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
netisr.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
pfil.c merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
pfil.h Change "inline" back to "__inline" in .h files -- C99 is still too 2006-02-16 20:17:12 +00:00
pfkeyv2.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
ppp_defs.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
ppp_tty.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
ppp-comp.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
ppp-deflate.c ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
radix.c Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"), 2006-02-25 00:58:34 +00:00
radix.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
raw_cb.c ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
raw_cb.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
raw_usrreq.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
route.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
route.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
rtsock.c Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
slcompress.c Perry reports that buf can be NULL, so deal with it. 2006-04-19 15:13:34 +00:00
slcompress.h ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
slip.h Multiple inclusion protection, as suggested by christos@ on tech-kern@ 2005-12-10 23:21:38 +00:00
zlib.c quell GCC 4.1 uninitialised variable warnings. 2006-05-10 21:53:14 +00:00
zlib.h zlib 1.2.3 changed the include protection variable names; adjust. 2006-01-14 20:17:12 +00:00