Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/net Pullup rev 1.17-1.18 (requested by darrenr in t...



details:   https://anonhg.NetBSD.org/src/rev/5c05a49357b6
branches:  netbsd-2-0
changeset: 560485:5c05a49357b6
user:      jmc <jmc%NetBSD.org@localhost>
date:      Wed Apr 21 03:56:20 2004 +0000

description:
Pullup rev 1.17-1.18 (requested by darrenr in ticket #167)

Reduce bpf buffer to 32k from 1M to reduce kernel memory usage from userland
binaries.
Fix bpf so that select will return for a timeout.
Fix the behaviour of BIOCIMMEDIATE.
In bpf_mtap(), optimise the calling of bpf_filter() and catchpacket()
based on whether or not the entire packet is in one mbuf.
Various other bpf fixes, including PR#8674, PR#12170

diffstat:

 sys/net/bpfdesc.h |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (47 lines):

diff -r 4a096f8c73ec -r 5c05a49357b6 sys/net/bpfdesc.h
--- a/sys/net/bpfdesc.h Wed Apr 21 03:56:17 2004 +0000
+++ b/sys/net/bpfdesc.h Wed Apr 21 03:56:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpfdesc.h,v 1.16 2003/08/07 16:32:48 agc Exp $ */
+/*     $NetBSD: bpfdesc.h,v 1.16.2.1 2004/04/21 03:56:20 jmc Exp $     */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -41,6 +41,7 @@
 #ifndef _NET_BPFDESC_H_
 #define _NET_BPFDESC_H_
 
+#include <sys/callout.h>
 #include <sys/select.h>
 
 /*
@@ -70,11 +71,13 @@
        struct bpf_insn *bd_filter;     /* filter code */
        u_long          bd_rcount;      /* number of packets received */
        u_long          bd_dcount;      /* number of packets dropped */
+       u_long          bd_ccount;      /* number of packets captured */
 
        u_char          bd_promisc;     /* true if listening promiscuously */
        u_char          bd_state;       /* idle, waiting, or timed out */
        u_char          bd_immediate;   /* true to return on packet arrival */
        int             bd_hdrcmplt;    /* false to fill in src lladdr */
+       int             bd_seesent;     /* true if bpf should see sent packets */
        int             bd_async;       /* non-zero if packet reception should generate signal */
        pid_t           bd_pgid;        /* process or group id for signal */
 #if BSD < 199103
@@ -85,8 +88,15 @@
        u_char          bd_pad;         /* explicit alignment */
        struct selinfo  bd_sel;         /* bsd select info */
 #endif
+       struct callout  bd_callout;     /* for BPF timeouts with select */
 };
 
+
+/* Values for bd_state */
+#define BPF_IDLE       0               /* no select in progress */
+#define BPF_WAITING    1               /* waiting for read timeout in select */
+#define BPF_TIMED_OUT  2               /* read timeout has expired in select */
+
 /*
  * Descriptor associated with each attached hardware interface.
  */



Home | Main Index | Thread Index | Old Index