Date: Fri, 09 Oct 1998 10:58:48 +0100 From: Brian Somers <brian@Awfulhak.org> To: Bill Fenner <fenner@parc.xerox.com> Cc: Eivind Eklund <eivind@yes.no>, Brian Somers <brian@Awfulhak.org>, Kris Kennaway <kkennawa@physics.adelaide.edu.au>, current@FreeBSD.ORG Subject: Re: Improper sharing of modem bandwidth Message-ID: <199810090958.KAA00774@woof.lan.awfulhak.org> In-Reply-To: Your message of "Thu, 08 Oct 1998 15:21:21 PDT." <98Oct8.152124pdt.177476@crevenia.parc.xerox.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> In message <19981008211441.00286@follo.net> Eivind wrote: > >#2 is probably the best (from the view of which possibilities it > >gives), but I also suspect it is what would give most work (unless bpf > >already can be used this way; then it would just be a question of > >making PPP use it.) > > [Jumping straight in where I know none of the context...] > > i = bpf_filter(program, (u_char *)m, ip->ip_len, 0) > > is all you need to do to run BPF program "program" on the packet in > mbuf m. > > The BPF program can return the packet's priority (i.e. by looking at > TCP ports or IP TOS or whatever) and then you could order the packets > in the queue by their priority. Maybe this is over-flexible ? It would be far easier (IMHO anyway) and wouldn't require any bpf code to create an ioctl something like struct portlist { int nports; u_short port[1]; }; struct portlist *p = (struct portlist *) malloc(sizeof *p + (nports-1) * sizeof p->port); p->nports = nports; for (i = 0; i < nports; i++) p->port[i] = ...; ioctl(tunfd, TIOCSETINTERACTIVEPORTS, p); Closing the device would clear the list, and ppp could simply #ifdef TIOCSETINTERACTIVEPORTS to see if it needs to do this... > Bill Having said all that, I suspect it would be easier to s/20/100/ as I originally suggested. If you've got more than 100 packets queued at a given time, surely the TCP window is way to large. -- Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org> <http://www.Awfulhak.org> Don't _EVER_ lose your sense of humour.... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810090958.KAA00774>